SanoScience / TTTSNet

Repository for open access paper for Medical Image Analysis submission related to Twin-to-Twin Transfusion Syndrome.
0 stars 0 forks source link

Dataset Issue #1

Open ymmm-4 opened 2 days ago

ymmm-4 commented 2 days ago

How to read labels? There are black images without masks.

simongeek commented 2 days ago

Hi, thank you for your comment.

As you can see in the data_loader.py file:

label_org = cv2.imread(self.labels[x], 0) if self.binary: label_org = np.where(label_org > 1, 0, label_org)

The masks are stored with [0, 1] values, where 0 represents the background, and 1 represents a placental vessel. These masks are not visible to the human eye.

To visualize the masks, you can use the code from the FetReg2021 challenge: https://github.com/sophiabano/EndoVis-FetReg2021/blob/master/Visualisation/Segmentation/fetreg2021_segmentation_vis.py, The colormap function should include only the background and vessels, as shown below:

def get_colormap(): """ Returns FetReg colormap """ colormap = np.asarray( [ [0, 0, 0], # 0 - background [255, 0, 0], # 1 - vessel ] ) return colormap