NifTK / NiftyNet

[unmaintained] An open-source convolutional neural networks platform for research in medical image analysis and image-guided therapy
http://niftynet.io
Apache License 2.0
1.36k stars 403 forks source link

Training with images of different sizes #412

Closed bsc0001 closed 5 years ago

bsc0001 commented 5 years ago

Hello!

I'm training a model for segmentation of stroke lesions on brain CT images. I found out it's an issue with the NiftyNet code to train if some of the images used have different amount of slices (a common matter in brain CT images), and therefore slightly different z dimensions. I'm trying to work on a solution, but despite some advances I haven't been able to solve it completely so far. If anything, I'll keep you updated.

In the meantime, I wonder if there is a way to use the info of some previous training and add it up to new trainings with a set of images with different z size. Instead of only being able to use the images for separate independent trainings, making up groups based on the amount of slices. I think it should possible, but I must be missing something out, because I can't find it.

I'd really appreciate the help, as I'm tight with time for a checkpoint to renew this research, to really have the time to update the improvements I'm working on.

Thank you in advance!

alekswithakayy commented 5 years ago

It's standard practice in deep learning to resize all images to a single set of dimensions/pixel spacings through interpolation and cropping. You will need to clean your data in this way using a image processing library. I'd recommend taking a look at SimpleITK as it is easy to use and tailored towards medical images.

anlarro commented 5 years ago

There is no need to use an external library. You can resize all images directly in NiftyNet by setting pixdim in the config file. For example: pixdim = (1, 1, 1) will resize all volumes to have isotropic voxel of 1mm.