Commit 89a3c28e authored by Taylor Hanayik's avatar Taylor Hanayik
Browse files

add fsleyes tooltip

parent ca7611d1
import { useState, useEffect, useRef, memo } from 'react'
import Box from '@mui/material/Box'
import LoadingButton from '@mui/lab/LoadingButton';
import { Button, Card, CardContent, Slider, Input, Collapse, Snackbar, FormControlLabel, Checkbox, Switch } from '@mui/material'
import { Button, Card, CardContent, Tooltip, Slider, Input, Collapse, Snackbar, FormControlLabel, Checkbox, Switch } from '@mui/material'
import { Container, CssBaseline, TextField, Typography, Grid, Divider } from '@mui/material'
import { Niivue, NVImage } from '@niivue/niivue'
import { io } from "socket.io-client";
......@@ -21,7 +21,7 @@ const runSocket = io(`ws://${host}:${socketServerPort}`)
const fsleyesSocket = io(`ws://${host}:${socketServerPort}`)
const nv = new Niivue()
const nv = new Niivue({clipPlaneColor:[0, 0, 0, 0]})
async function addNiiVueImage(url, color='red') {
let img = await NVImage.loadFromUrl(url,'',color,0.8)
......@@ -261,6 +261,7 @@ function CommandStringPreview({commandString}) {
}
function UseCrosshairsSwitch({useCrosshairs, setUseCrosshairs, options}) {
let fsleyesString = `fsleyes ${options['input']} ${options['output']} -cm red -a 80`
return (
<Grid
container
......@@ -271,7 +272,9 @@ function UseCrosshairsSwitch({useCrosshairs, setUseCrosshairs, options}) {
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>
<Tooltip title={fsleyesString}>
<Button style={{margin:0, textTransform: 'none'}} onClick={() => {fsleyesSocket.emit('run', {'run': fsleyesString})}}>open FSLeyes</Button>
</Tooltip>
</Grid>
)
......
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