zhixuhao / unet

unet for image segmentation
MIT License
4.56k stars 2k forks source link

Semantic segmentation and classification by pixel wise labeling #144

Open chinya07 opened 5 years ago

chinya07 commented 5 years ago

@zhixuhao I need help regarding the classification part after semantic segmentation. I able to successfully generate segment prediction on test images. Now I want to label each pixel of specific object in the image with its corresponding label. I tried using many open source tools but they all are providing polygon region labeling method. I tried using slicer for pixel wise labeling it generates .seg file but then how to provide pixel data and labels to U-Net for classification.

deaspo commented 5 years ago

@chinya07 I used slicer to create corresponding labels for the images. When using slicer, after creating the .seg.nrrd file, close and load it as a volume using Slicer again (not as Segmentation). Then use the Create a Dicom Series plugin to create .dcm file for each slice in the volume and export. (You can do the same for the image files). Note Output type for the segmentation is Unsigned char, for the images (if you are also doing this), can be short or unsigned char.

In some case you may end up using the Resample Image (BRAINS) plugin to make sure the /seg/nrrd has the same image diemension as the original image volume.

In my case I used IrfanView to convert the dicom slices to .png files which I could now use as image and labels for training instead of test images.

ps: I was dealing with DICOM images and used the above to create my images. Plugins mentioned should work for any data loaded in Slicer as volume

chinya07 commented 5 years ago

@deaspo Thank you! But how can I provide this to U-Net model. How to use the image and and the labels for the training. How to provide .seg.nrrd file data to U-Net model?

deaspo commented 5 years ago

@deaspo Thank you! But how can I provide this to U-Net model. How to use the image and and the labels for the training. How to provide .seg.nrrd file data to U-Net model?

When using slicer, after creating the .seg.nrrd file, close and load it as a volume using Slicer again (not as Segmentation). Then use the Create a Dicom Series plugin to create .dcm file for each slice in the volume and export. (You can do the same for the image files). Note Output type for the segmentation is Unsigned char, for the images (if you are also doing this), can be short or unsigned char.

In some case you may end up using the Resample Image (BRAINS) plugin to make sure the .seg.nrrd has the same image diemension as the original image volume.

In my case I used IrfanView to convert the dicom slices to .png files which I could now use as image and labels for training instead of test images.