neuroanatomy / BrainBox

BrainBox is a web application that lets you annotate and segment 3D brain imaging data in real time, collaboratively.
https://brainbox.pasteur.fr
Other
96 stars 46 forks source link

How should volume annotations be uploaded? #146

Closed Shotgunosine closed 7 years ago

Shotgunosine commented 7 years ago

I'm trying to make a Macaque brain atlas viewable through brainbox, and I can view the base image without any issues. I can't seem to figure out how to upload volume annotations though. Is there any documentation about how those need to be formatted? Are there any options for uploading annotations that aren't one of the preset types?

http://brainbox.pasteur.fr/project/nmt

Thanks,

Dylan

katjaq commented 7 years ago

Hi Dylan,

thank you for getting in touch. Fantastic that you would like to add your data to BrainBox!! :) (Wooow, beautiful resolution!) Sorry, that you are facing trouble. When clicking on the link you provided, I can see the cerebrum segmentation – does that mean your problem is solved or is there other data which you would like to add? To upload one single volume annotation, you can go to your MRI image, and use the upload button from our tools. It should show your atlas file. (BrainBox currently is able to handle .nii.gz and .mgz files.) This upload would go to our default, which is just one color. If you have a more complex atlas file, you can go to the settings of your project (upper right corner left of your user name there is a cog icon) and you can see and edit the settings of your project. If you go there, you will see in the annotations table your uploaded file 'test'. In the third column (Value) it will read 'cerebrum' – which will give you a palette of one colour only. If you change this to another, like 10 regions, (10 colours) or freesurfer:48 (48 colours), and click the 'save changes' button on the left below the project avatar, it will display your atlas file in different colours according to the segmentation you uploaded (in case there is more than one label). (since I am not part of your project, I can't try it now. I hope it will answer your question. In case of more questions, please feel free to get back to us any time! :) )

((If you would like to add lots of MRI files and also lots of segmentation files, use the csv import for the MRI files and names of subjects and curl upload for the segmentations.)) We are working on user manual, including jupyter notebook workflow...

Hope it will solve your problem :)

many cheers, katja

Shotgunosine commented 7 years ago

Ok, I think I'm following. If I want to add a set of colors and region names that's not one of the current Label Sets should I just submit a pull request with my json added? Or is there a way to upload a json label file for my project to use?

r03ert0 commented 7 years ago

For the moment, the only way of having a new set of regions is by creating a .json file with the colours and region names, such as https://github.com/OpenNeuroLab/BrainBox/blob/master/public/labels/freestyle.json

It looks like:

{
    "name":"10 regions",
    "source":"http://brainbox.pasteur.fr/labels/freestyle.json",
    "labels":[
        {"name":"Region 1","value":1,"color":[205,62,78],"url":""},
        {"name":"Region 2","value":2,"color":[255,165,0],"url":""},
        {"name":"Region 3","value":3,"color":[255,255,0],"url":""},
        {"name":"Region 4","value":4,"color":[255,137,241],"url":""},
        {"name":"Region 5","value":5,"color":[236,13,176],"url":""},
        {"name":"Region 6","value":6,"color":[120,18,134],"url":""},
        {"name":"Region 7","value":7,"color":[103,255,255],"url":""},
        {"name":"Region 8","value":8,"color":[21,86,225],"url":""},
        {"name":"Region 9","value":9,"color":[135,237,121],"url":""},
        {"name":"Region 10","value":10,"color":[0,118,14],"url":""}
        ]
}

You provide a name to your label set ("10 Regions" in this case), a link to the file (here http://brainbox.pasteur.fr/labels/freestyle.json), and then an array with all the regions.

Each region has its own name (here "Region 1", "Region 2", etc.), a colour (unique, given as red, green and blue values), and finally a URL with the definition of what that region is. This URL is mostly a placeholder for the moment, but ideally, it should point to the region definition in Neurolex, for example. If a region were, for example, "Temporal Lobe", the URL could point to "http://neurolex.org/wiki/Category:Temporal_lobe".

To integrate the new label set into brainbox, you can do a pull request (new label sets are added inside the 'labels' directory, inside the 'public' directory), or send the file along and we can upload it.

Once your new label set is integrated in brainbox, it will be available to all users! (so, try to make it nice :D)