MIC-DKFZ / nnUNet

Apache License 2.0
5.86k stars 1.75k forks source link

View the 2D slices of 3D data. #2246

Closed jiashizuo closed 1 day ago

jiashizuo commented 5 months ago

Hello, I would like to know how the slicing of 3D data is done when training a 2D model. For example, can I view these slices after the training is completed? I noticed that the data is stored in 3D format. Is there an ID for the data slices (I have not found the location of this) that would allow me to view these 2D slices? I also want to know along which axis the 3D data is sliced. Thank you so much.

TaWald commented 5 months ago

Hey jiashizuo, generally it is not recommended to train 2D models over 3D models (and 2D is generally always worse). That being said, I am not familiar with the 2D behavior, but I would expect nnU-Net to slice along the in-plane dimension of your data, as the resolution along that dimension will be mostly isotropic. This is an assumption and if you want to be sure you should check the code used during 2D training.

For example, can I view these slices after the training is completed?

After prediction nnunet recreates the 3D volumes from the 2D slices it used to predict. As one is generally interested in the entire volume not a single slice single slices are not provided. But you can simply use any 3D viewer or write yourself some scripts if you are interested in getting specific indices.

TaWald commented 1 day ago

Closing this due to inactivity