[MINC-users] Volumes containing NaN and mincresample

Soren Christensen sorench at gmail.com
Wed Apr 17 13:10:47 EDT 2013


Hi Andrew,
 I can directly answer your question but this is something I have been
dealing with too.
So you have a region with "valid" values and a NaN valued region. What do
you want to happen in terms of interpolation at the interface between these
two regions?  That anything "contaminated" by NaN is set to NaN or that the
interpolated value excludes NaNs from the neighborhood?
In both cases I believe you can achieve this by transforming a [1/0] mask
(as float using non-nearest IP) and then use that result as an indicator of
what was contaminated by exterior contributions and how much. You can then
adapt you image based on this.

Soren




On Wed, Apr 17, 2013 at 8:14 AM, Andrew Wood <andrew at biospective.com> wrote:

> 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
> _______________________________________________
> MINC-users at bic.mni.mcgill.ca
> http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users
>


More information about the MINC-users mailing list