From dany at biospective.com Thu Nov 26 08:40:24 2020 From: dany at biospective.com (Dany Chagnon) Date: Thu, 26 Nov 2020 08:40:24 -0500 Subject: [MINC-users] mincbbox on volume with a scale of 0 Message-ID: Dear MINC users, There seems to be an issue with mincbbox on volumes with a single value, but with a range of possible voxel values. To reproduce that issue, you can create a volume with: 1- make_phantom -signed -short -voxel_range -10 100 2- minccalc -expression '1' That yields a volume filled with 1s, but with voxel that could range from -10 to 100. Calling mincbbox on that volume returns "X X X -inf -inf -inf" where X is 1.8E308. Repeating those same steps, but filling the volume with values >10 would not have this issue. As far as I can tell this is because the scale is forced to take a non-zero value here: https://github.com/BIC-MNI/libminc/blob/master/volume_io/Volumes/volumes.c#L2537-L2543 I can see two main ways to see that issue: 1) allow the scale to be 0 in libminc 2) rescale the voxel range in minccalc Best regards, Dany From gabriel.devenyi at mcgill.ca Thu Nov 26 09:37:57 2020 From: gabriel.devenyi at mcgill.ca (Gabriel A. Devenyi) Date: Thu, 26 Nov 2020 09:37:57 -0500 Subject: [MINC-users] mincbbox on volume with a scale of 0 In-Reply-To: References: Message-ID: Hi Dany, Would you please open an issue on the libminc github. Thanks. -- Gabriel A. Devenyi Ph.D. Research Computing Associate Computational Brain Anatomy Laboratory Cerebral Imaging Center Douglas Mental Health University Institute Affiliate, Department of Psychiatry McGill University t: 514.761.6131x4781 e: gabriel.devenyi at mcgill.ca On Thu, 26 Nov 2020 at 08:40, Dany Chagnon wrote: > Dear MINC users, > > There seems to be an issue with mincbbox on volumes with a single value, > but with a range of possible voxel values. To reproduce that issue, you can > create a volume with: > 1- make_phantom -signed -short -voxel_range -10 100 > 2- minccalc -expression '1' > That yields a volume filled with 1s, but with voxel that could range from > -10 to 100. Calling mincbbox on that volume returns "X X X -inf -inf -inf" > where X is 1.8E308. Repeating those same steps, but filling the volume with > values >10 would not have this issue. > > As far as I can tell this is because the scale is forced to take a non-zero > value here: > > https://github.com/BIC-MNI/libminc/blob/master/volume_io/Volumes/volumes.c#L2537-L2543 > > I can see two main ways to see that issue: > 1) allow the scale to be 0 in libminc > 2) rescale the voxel range in minccalc > > Best regards, > Dany > _______________________________________________ > MINC-users at bic.mni.mcgill.ca > https://mailman.bic.mni.mcgill.ca/mailman/listinfo/minc-users >