frankkramer-lab / MIScnn

A framework for Medical Image Segmentation with Convolutional Neural Networks and Deep Learning
GNU General Public License v3.0
402 stars 116 forks source link

How do we create a data interface without segmentations for prediction only? [Help Wanted] #164

Open joaomamede opened 1 year ago

joaomamede commented 1 year ago

Hi all, I tried to create a Data_IO without segmentations.nii.gz and only the imaging data, but it fails when the file is not present.

I trained the model already, it's perfect I want to use it for some research. But I always need to create a fake empty "segmentation.nii.gz" to be able to simple predict from the images.

Any hints? Thanks for MIScnn!

from miscnn.data_loading.interfaces.nifti_io \
     import NIFTI_interface
from miscnn.data_loading.data_io import Data_IO

interface = NIFTI_interface( 
                            channels=1, 
                            classes=4,
                            three_dim=True,
                            )

data_path = "/home/jmamede/Data/monkeys/NEW_trial_files/data/"
batch_path="/home/jmamede/Data/monkeys/batches")
data_io = Data_IO(interface, data_path,
                  output_path=data_path+'/predictions'
                 )
muellerdo commented 1 year ago

Hey @joaomamede,

always happy to hear that you can utilize MIScnn in your research! :)

Can you provide the error message you get if you do not create a fake segmentation.nii.gz?

Normally, you should be able to just call the DataIO on only testing data like the following file structure:

ct_scans/
   scan_a/
      imaging.nii.gz
   scan_b/
      imaging.nii.gz
   scan_c/
      imaging.nii.gz

Cheers, Dominik