Mohinta2892 / catena

Neuron Segmentation, Synaptic Partner Detection and Microtubule tracking for vEM with EM-2-EM translation. Codebase built upon Funke lab's algorithms.
7 stars 1 forks source link

Gunpowder AssertionError: Cannot pick a random location, intersection of upstream ROIs is unbounded. #4

Open Mohinta2892 opened 6 months ago

Mohinta2892 commented 6 months ago

Error in RandomLocation: AssertionError: Can not pick a random location, intersection of upstream ROIs is unbounded.

This happens if the input shape is larger than the shape of the volumes. Example: You have bunch of volumes of which the smallest has the following shapes, it will clearly cause a problem as the raw is never padded.

Mohinta2892 commented 6 months ago

For Zebrafinch ground truth data, the labels exist in 128 x 256 x 256 and 150 x 150 x 150 px. Labels padding when calculated as below does not work:

    p = int(round(np.sqrt(np.sum([i * i for i in output_shape])) / 2))

    # Ensure that our padding is the closest multiple of our resolution
    labels_padding = Coordinate([j * round(i / j) for i, j in zip([p, p, p], list(voxel_size))])
    print('Labels padding:', labels_padding)

We do two things to circumvent this problem (may not be the best solution, works for now):

Mohinta2892 commented 2 months ago

Why this happens?

ERROR:

Traceback (most recent call last):                  
  File "/net/ark/scratch/smohinta/connexion/codebases/restructured_packages/local_shape_descriptors/conda_env/src/gunpowder/gunpowder/nodes/batch_provider.py", line 182, in request_batch
    self.check_request_consistency(request)                                                                                                                                                                                                                                        
  File "/net/ark/scratch/smohinta/connexion/codebases/restructured_packages/local_shape_descriptors/conda_env/src/gunpowder/gunpowder/nodes/batch_provider.py", line 249, in check_request_consistency
    request_roi.shape[d] % provided_spec.voxel_size[d] == 0                                                                                                                                                                                                                        
TypeError: unsupported operand type(s) for %: 'NoneType' and 'int'