niftynet

Don't know how to generate sampling locations:


How are the dimensions generated in the uniform sampler? I tried debugging the image size it seems it works for some of the iterations it does not for others. Any idea how to fix this. My configuration is given below :

[CUSTOM]

name: net_segment

[CONFIG_FILE]

[IMAGES]

[LABEL]

-csv_file:

[SYSTEM]

[NETWORK]

[TRAINING]

[INFERENCE]

CRITICAL:niftynet: Don't know how to generate sampling locations: Spatial dimensions of the grouped input sources are not consistent. {(477, 451, 187), (391, 369, 147)} Exception in thread Thread-2: Traceback (most recent call last): File "/home/ubuntu/anaconda3/envs/python3/lib/python3.6/threading.py", line 916, in _bootstrap_inner self.run() File "/home/ubuntu/anaconda3/envs/python3/lib/python3.6/threading.py", line 864, in run self._target(*self._args, **self._kwargs) File "/home/ubuntu/niftynet/NiftyNet/niftynet/engine/image_window_buffer.py", line 148, in _push for output_dict in self(): File "/home/ubuntu/niftynet/NiftyNet/niftynet/engine/sampler_uniform.py", line 81, in layer_op self.window.n_samples) File "/home/ubuntu/niftynet/NiftyNet/niftynet/engine/sampler_uniform.py", line 151, in _spatial_coordinates_generator _infer_spatial_size(img_sizes, win_sizes) File "/home/ubuntu/niftynet/NiftyNet/niftynet/engine/sampler_uniform.py", line 238, in _infer_spatial_size raise NotImplementedError NotImplementedError


Solution

  • The issue is resolved here: https://github.com/NifTK/NiftyNet/issues/170

    In summary images and labels should have the same voxel spacing values stored in their header when pixdim is set in the configuration file.