davhunt / app-benson14-retinotopy

Brainlife.io app for Noah Benson's neuropythy library, retinotopy from T1 anatomy
MIT License
1 stars 5 forks source link

Organize output as neuro/prf datatype #2

Open soichih opened 5 years ago

soichih commented 5 years ago

I've registered neuro/prf datatype(https://brainlife.io/datatype/5d9d18d8e30ae43bb0612715). Please update this App so that it will generate output in this datatype format.

I will soon register the prf viewer for this datatype so that user can visualize the output using our new pRF viewer.

soichih commented 5 years ago

Also.. I just spoke with Brad.. We should store varea.nii.gz neuro/parcellation/volume as it is a segmented volume. Can you update so that varea.nii.gz is stored as varea/parc.nii.gz and add "varea" as an output that's separate from prf? I will remove the varea.nii.gz from the neuro/prf.

davhunt commented 5 years ago

Sure-- I think it should still be a possible input for ui-prf app visualizer though right?

soichih commented 5 years ago

Humm.. good point. I think we might need to keep varea.nii.gz as part of neuro/prf just for vis purpose only? Can you keep the varea under ./prf/varea.nii.gz, but also create a copy under ./varea/parc.nii.gz?

soichih commented 5 years ago

Also.. I've added "./surfaces" directory as a required directory for neuro/prf. This directory should contain the following files.

surfaces/lh.pial.vtk
surfaces/lh.white.vtk
surfaces/lh.inflated.vtk
surfaces/rh.pial.vtk
surfaces/rh.white.vtk
surfaces/rh.inflated.vtk

You can easily create these files from the freesurfer output by running a script like this

mris_convert --to-scanner fs/output/surf/lh.white surfaces/lh.white.vtk
mris_convert --to-scanner fs/output/surf/rh.white surfaces/rh.white.vtk
mris_convert --to-scanner fs/output/surf/lh.pial surfaces/lh.pial.vtk
mris_convert --to-scanner fs/output/surf/rh.pial surfaces/rh.pial.vtk
mris_convert --to-scanner fs/output/surf/lh.sphere surfaces/lh.sphere.vtk
mris_convert --to-scanner fs/output/surf/rh.sphere surfaces/rh.sphere.vtk
mris_convert --to-scanner fs/output/surf/lh.inflated surfaces/lh.inflated.vtk
mris_convert --to-scanner fs/output/surf/rh.inflated surfaces/rh.inflated.vtk

Please see https://github.com/brainlife/app-prf/blob/master/convert.sh

soichih commented 4 years ago

Also.. for neuro/parcellation/volume output, we need to generate key.txt (deprecated - but still used) and label.json describing the voxel values.

For now, I think we can create static files as part of the repo.

varea/key.txt

0 -> 1 == V1
0 -> 2 == V2
0 -> 3 == V3
0 -> 4 == hV4
0 -> 5 == VO1
0 -> 6 == VO2
0 -> 7 == LO1
0 -> 8 == LO2
0 -> 9 == TO1
0 -> 10 == TO2
0 -> 11 == V3b
0 -> 12 == V3a

varea/label.json

[
    {
        "name": "no visual area",
        "desc": "no visual area",
        "voxel_value": 0
    },
    {
        "name": "V1",
        "label": "400",
        "voxel_value": 1
    },
    {
        "name": "V2",
        "label": "401",
        "voxel_value": 2
    },
    {
        "name": "V3",
        "voxel_value": 3
    },
    {
        "name": "hV4",
        "voxel_value": 4
    },
    {
        "name": "VO1",
        "voxel_value": 5
    },
    {
        "name": "VO2",
        "voxel_value": 6
    },
    {
        "name": "LO1",
        "voxel_value": 7
    },
    {
        "name": "LO2",
        "voxel_value": 8
    },
    {
        "name": "TO1",
        "voxel_value": 9
    },
    {
        "name": "TO2",
        "voxel_value": 10
    },
    {
        "name": "V3b",
        "voxel_value": 11
    },
    {
        "name": "V3a",
        "voxel_value": 12
    }
]