[MINC-users] Volumes containing NaN and mincresample
Andrew Wood
andrew at biospective.com
Wed Apr 17 11:14:14 EDT 2013
Hi All,
I've been running into trouble resampling an image in which there are
voxels that carry no meaning. It is essentially a masked image, where
meaningful data is anything non-zero. When I resample the image, the
meaningless zeros are treated as real data for interpolation and leak into
the image (for interpolants other than nearest neighbour).
Of course there's nothing special about zero, so I tried this:
$ minccalc -expression 'A[0] < 1e-5 ? NaN : A[0]' zeros.mnc NaNs.mnc
When I resample NaNs.mnc, I still end up with meaningless voxels leaking
into the image.
How are NaNs represented in the minc world? It looks like they're simply
stored as its slice's minimum value:
$ mincextract -start 0,0,0 -count 1,1,1 NaNs.mnc
1.2451361867704378028
$ mincinfo -varvalue image-min NaNs.mnc | head -n 1
1.245136186770423592
Should mincresample treats the NaNs generated by minccalc as real values?
Is there a way to persuade mincresample interpolants to ignore a specific
value (i.e. NaN)?
Thanks,
Andrew
More information about the MINC-users
mailing list