bigmb/Unet-Segmentation-Pytorch-Nest-of-Unets

what is the 2d_from_3d?

XUYUNYUN666 opened this issue · 8 comments

How to use the code?

bigmb commented

That code is for getting the 2d slices from 3D mri scans.
Just have to add the folder in the first lines and it will give you the slices.

That code is for getting the 2d slices from 3D mri scans.
Just have to add the folder in the first lines and it will give you the slices.

But if my dataset is 2d with input_channels 3, and the label is the gray, what should i do? thank you

bigmb commented

You dont want to use the 2D_from_3d in your code if you want to run the unet.
You just have to add the folder path to these lines in pytorch)run :

t_data = '' # Input data
l_data = '' #Input Label
test_image = '' #Image to be predicted while training
test_label = '' #Label of the prediction Image
test_folderP = '' #Test folder Image
test_folderL = '' #Test folder Label for calculating the Dice score

You dont want to use the 2D_from_3d in your code if you want to run the unet.
You just have to add the folder path to these lines in pytorch)run :

t_data = '' # Input data
l_data = '' #Input Label
test_image = '' #Image to be predicted while training
test_label = '' #Label of the prediction Image
test_folderP = '' #Test folder Image
test_folderL = '' #Test folder Label for calculating the Dice score

Hi ,I want to ask you a question,
Using CenterCrop(96) in Data_Loader() in the code, but my dataset's size is(400,600), so I want to know how to change the code.
My code is CenterCrop((600,400)) or Resize((600,400)), do you think the modification is right?

bigmb commented

You dont have to change anything.
In the pytorch_run in line 120, change the transformation to (96)

hello, I have one question for 2d_from_3d.py in line 21 and line 31, the code 'x = yimage[:184,:232,112:136]'. Could you please tell what does it mean to use [:184,:232,112:136] and how can i set the parameters for my own dataset with shape(155,240,240)? Thanks in advance

bigmb commented

I have taken [:184,:232,112:136] because I just wanted those slices of the 3d mri. So my 2d images extracted will just be from 112:136 , that is my area of interest.

I have taken [:184,:232,112:136] because I just wanted those slices of the 3d mri. So my 2d images extracted will just be from 112:136 , that is my area of interest.

Thanks for you reply