Closed Kimmm-pzl closed 1 year ago
Hi,
In addition, I want to ask whether the pixel value matches the labels in the "label.txt" after getting the divided ".nii file", so that the structure name can be determined according to the pixel value of the ".nii file"? In other words, how to match RGB values in "label.txt" to pixels in ".nii file". Thanks again and look forward to your reply!
Best Kim
Hi @Kimmm-pzl, by construction, the network will always return all labels. When you are only interested in one label, you can look up the integer index from the label.txt
file, e.g. 5 for GPI_R and only look at these values in the result nifti (effictivly generating a binary mask for the GPI_R from it).
Python Pseudocode:
# Load the NIfTI file
nifti_file = nib.load('dbsegment_output.nii')
# Access the data array and header information
nifti_data = nifti_file.get_fdata()
# get a binary GPI_R only mask from the integer segmentation partition
mask_GPI_R = nifti_data == 5
Thanks for your reply, it helped me a lot!
Best Kim
Hi
How do I specify the area I want to split, instead of splitting all 30 areas at once. For example, only split on 'GPI_L' and 'GPI_R' Thank you for your reply!
Best Kim