Procedure for labelmap volume generation and color table


I have a segmentation file in .nii.gz format. My objective is to convert the segmentation file to a labelmap volume with my own specfied color, and then the segmentation result can be visualized in web brower using ‘xtk’ javascript library? Actually, the segmentation file has stored manual contouring of lesion and consists of the values of 0 and 1 only.

Can anyone guide the procedure of generating labelmap volume with user-defined color table? Also, is there any trick to specify and include the setting of user-defined color table in the labelmap volume?

Thank you very much in advance.


Hi - I haven’t used XTK in a while, but I believe you can do what you describe with just some simple JavaScript code, no particular Slicer operations required. To start you can probably just drop your nii file onto to visualize it.

Hi. Actually, my question is related to the usage of slicer. I guess the problem caused by the generation of labelmap and the labelmap cannot be read by xtk library. So, I was wondering whether the labelmap generated by slicer cannot be read by the xtk library.