PytorchDigitalPathology icon indicating copy to clipboard operation
PytorchDigitalPathology copied to clipboard

Squeeze the patches of masks before appending them to ndarray may be unnecessary or raise errors.

Open CielAl opened this issue 6 years ago • 0 comments

Hi, it appears that the slicing in numpy array would automatically remove the trailing singleton dimension. The slice io_arr_out[:,:,:,0] is already npatches x patch_size x patch_size, given that the shape of io_arr_out is npatches x patch_size x patch_size x 3 (for 3-channel inputs).

Also, in one of my slides, the annotated area without downsampling is already small enough, and the downsampled ROI yields a tile smaller than the patch_size, which makes its padded version of io_arr_out to be 1x patch_size x patch_size x 3.

Using squeeze will incorrectly collapse the leading singleton dimension which we don't want to drop, and raise errors because the rank of the result will mismatch the rank of the hdf5 array.

CielAl avatar Nov 27 '18 14:11 CielAl