Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
FSL
gui
fsl-gui-bet
Commits
d709b140
Commit
d709b140
authored
Feb 25, 2022
by
Taylor Hanayik
Browse files
fix switch to use crosshair for -c option
parent
e5cb9477
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/App.jsx
View file @
d709b140
...
...
@@ -303,30 +303,27 @@ export default function Bet() {
const
[
commandString
,
setCommandString
]
=
useState
(
''
)
const
[
isRunning
,
setIsRunning
]
=
useState
(
false
)
const
[
niivueImage
,
setNiivueImage
]
=
useState
(
''
)
const
[
voxStr
,
setVoxStr
]
=
useState
(
''
)
if
(
host
===
null
||
socketServerPort
===
null
||
fileServerPort
===
null
){
setSnackBarMessage
(
'
unable to contact backend application
'
)
}
nv
.
on
(
'
location
'
,
(
location
)
=>
{
setVoxStr
(
`
${
location
.
vox
[
0
]}
${
location
.
vox
[
1
]}
${
location
.
vox
[
2
]}
`
)
//updateBetOptsValue('-c', voxStr)
})
inFileSocket
.
on
(
'
files
'
,
(
data
)
=>
{
console
.
log
(
data
)
updateBetOptsValue
(
'
input
'
,
data
[
0
])
setNiivueImage
(
`http://
${
host
}
:
${
fileServerPort
}
/file/?filename=
${
data
[
0
]}
`
)
/*
nv.loadVolumes([
{url: `http://${host}:${fileServerPort}/file/?filename=${data[0]}`}
])
*/
})
runSocket
.
on
(
'
run
'
,
(
data
)
=>
{
console
.
log
(
'
run
'
,
data
)
setIsRunning
(
false
)
setNiivueImage
(
`http://
${
host
}
:
${
fileServerPort
}
/file/?filename=
${
betOpts
[
'
output
'
]}
`
)
/*
nv.loadVolumes([
{url: `http://${host}:${fileServerPort}/file/?filename=${betOpts['output']}`}
])
*/
})
function
handleSnackBarClose
()
{
...
...
@@ -341,6 +338,16 @@ export default function Bet() {
// whenever the snackbar message changes, run the effect (e.g. show the snackbar to the user when the message is updated)
useEffect
(()
=>
{
showSnackBarIfMsg
()},
[
snackBarMessage
])
useEffect
(()
=>
{
updateCommandString
()},
[
betOpts
])
useEffect
(()
=>
{
if
(
useCrosshairs
)
{
updateBetOptsValue
(
'
-c
'
,
voxStr
)
}
},
[
voxStr
])
useEffect
(()
=>
{
if
(
voxStr
!==
''
)
{
updateBetOptsValue
(
'
-c
'
,
''
)
}
},
[
useCrosshairs
])
function
setOutputName
(
fileName
)
{
if
(
fileName
===
''
)
{
...
...
@@ -387,7 +394,7 @@ export default function Bet() {
...{
'
output
'
:
setOutputName
(
value
)}
}))
}
updateCommandString
()
//
updateCommandString()
}
return
(
...
...
@@ -429,6 +436,7 @@ export default function Bet() {
updateBetOptsValue
=
{
updateBetOptsValue
}
/>
<
CommandStringPreview
commandString
=
{
commandString
}
/>
<
UseCrosshairsSwitch
useCrosshairs
=
{
useCrosshairs
}
setUseCrosshairs
=
{
setUseCrosshairs
}
/>
<
NiiVue
url
=
{
niivueImage
}
/>
<
Snackbar
anchorOrigin
=
{
{
horizontal
:
'
center
'
,
vertical
:
'
bottom
'
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment