Commit ca7611d1 authored by Taylor Hanayik's avatar Taylor Hanayik
Browse files

add open in FSLeyes button

parent 80fa4527
......@@ -18,6 +18,8 @@ console.log(host, socketServerPort, fileServerPort)
// different socket clients for different widgets
const inFileSocket = io(`ws://${host}:${socketServerPort}`)
const runSocket = io(`ws://${host}:${socketServerPort}`)
const fsleyesSocket = io(`ws://${host}:${socketServerPort}`)
const nv = new Niivue()
......@@ -164,7 +166,7 @@ function FvalueField({f, updateBetOptsValue}) {
)
}
function ActionButtons({handleMoreOptions, commandString, isRunning, setIsRunning}) {
function ActionButtons({handleMoreOptions, commandString, isRunning, setIsRunning, options}) {
return (
<Grid container item xs={12} alignItems='center' justifyContent='center' spacing={0} direction='row'>
<LoadingButton
......@@ -176,7 +178,7 @@ function ActionButtons({handleMoreOptions, commandString, isRunning, setIsRunnin
>
Run
</LoadingButton>
<Button style={{margin:0}} onClick={handleMoreOptions}>more options</Button>
<Button style={{margin:0}} onClick={handleMoreOptions}>more options</Button>
</Grid>
)
}
......@@ -258,7 +260,7 @@ function CommandStringPreview({commandString}) {
)
}
function UseCrosshairsSwitch({useCrosshairs, setUseCrosshairs}) {
function UseCrosshairsSwitch({useCrosshairs, setUseCrosshairs, options}) {
return (
<Grid
container
......@@ -269,7 +271,9 @@ function UseCrosshairsSwitch({useCrosshairs, setUseCrosshairs}) {
direction='row'
>
<FormControlLabel control={<Switch checked={useCrosshairs} onChange={()=>{setUseCrosshairs(!useCrosshairs)}} />} label="use crosshair position to set starting point" />
<Button style={{margin:0, textTransform: 'none'}} onClick={() => {fsleyesSocket.emit('run', {'run': `fsleyes ${options['input']} ${options['output']}`})}}>open FSLeyes</Button>
</Grid>
)
}
......@@ -443,6 +447,7 @@ export default function Bet() {
commandString={commandString}
isRunning={isRunning}
setIsRunning={setIsRunning}
options={betOpts}
/>
<OptionsContainer
moreOptions={moreOptions}
......@@ -450,7 +455,7 @@ export default function Bet() {
updateBetOptsValue={updateBetOptsValue}
/>
<CommandStringPreview commandString={commandString}/>
<UseCrosshairsSwitch useCrosshairs={useCrosshairs} setUseCrosshairs={setUseCrosshairs} />
<UseCrosshairsSwitch useCrosshairs={useCrosshairs} setUseCrosshairs={setUseCrosshairs} options={betOpts} />
<NiiVue url={niivueImage}/>
<Snackbar
anchorOrigin={{horizontal:'center', vertical:'bottom'}}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment