MedSegDiff icon indicating copy to clipboard operation
MedSegDiff copied to clipboard

Brats3D dataloader

Open saisusmitha opened this issue 2 years ago • 5 comments

@WuJunde Hi. In brats data loader code - in BRATSDataset3D Why is there n = x // 155 #quotientslice = x % 155 #remainder given - I think it's saying which slice to consider - are we considering only one slice out of 155 for training? Also when I run segmentation_sample.py the batch size is 1 and the same folder i.e single folder from the dataset directory is selected every time - I don't know y can you help me out

saisusmitha avatar Apr 17 '23 18:04 saisusmitha

n is the index of which volume it is, slice index (x) // slice number one volume(155) == the index of volume (n)

WuJunde avatar Apr 17 '23 20:04 WuJunde

@WuJunde I understood it partially Tq. Is this the site(https://www.med.upenn.edu/cbica/brats2020/data.html) from where the data is downloaded because the folders are not slice wise as you showed in readme. It shows lots of slice wise folders data └───training │ └───slice0001 │ │ t1.nii.gz │ │ t2.nii.gz │ │ flair.nii.gz │ │ t1ce.nii.gz │ │ seg.nii.gz │ └───slice0002 Kindly tell me how to preprocess to get such slice-wise folder. I downloaded it from the above link and the data loader works without changing much of it (so did you show just renamed version of original data or you had to do some preprocessing to convert into slice wise folders?) Also, can you explain what exactly the brats3d dataset class does i.e the preprocessing part? What is the dataset for validation? did you split the training data into 332 for train and 37 for validation? For validation suppose there are 37 images in validation folder,in segmentation_sample.py while loading them, the n is always 0 as 37 is less than 155 and only 1st folder which is saved in the database (filedict = self.database[n]) is getting selected, and evaluated in the loop. Kindly correct my understanding as explained above I am facing issues. This is how the datset looks for me. Its a folder for each patient. Kindly tell if there is some preprocessing in saving them to slice wise folders as you showed in readme brats3d brstas3d_1

saisusmitha avatar Apr 17 '23 22:04 saisusmitha

brats3d loader is used for volume data, like yours. another brats dataloader is used for the slices data, as which I show In readme. so you can just use brats3d loader, no need to prepare dataset follow my readme.

WuJunde avatar Apr 18 '23 04:04 WuJunde

@WuJunde Tq. Can you share the code to process them into slices as you did. In the dowloaded dataset there are 369 patients so 369 folders. Then does n represent 0 to 369? Can you tell me what exactly n and x is in brats3d dataset

My another question is: What is the dataset for validation? did you split the training data into 332 for train and 37 for validation? Suppose for validation there are 37 images in validation folder,in segmentation_sample.py while loading them, the n is always 0 as 37 is less than 155 and only 1st folder which is saved in the database (filedict = self.database[n]) is getting selected, and evaluated in the loop. Kindly correct my understanding as explained above I am facing issues.

Kindly explain and share the code for saving 3d data slice wise as you did.

saisusmitha avatar Apr 18 '23 06:04 saisusmitha

@WuJunde Kindly help me withe above issues

saisusmitha avatar Apr 29 '23 18:04 saisusmitha