[MINC-users] Building xfm2def

Andrew Wood andrew at biospective.com
Thu Mar 3 07:43:14 EST 2016


Hi Andrew,

I didn't open the grid directly, but rather showed what happened after
applying it to a 3D volume.

Instead of passing parameters to xfm2def to control the grid output, I used
make_phantom parameters to make my data match xfm2def's defaults. Here's
what I mean:

$ xfm2param -rotations 30 30 30 ./rotations.xfm
$ xfm2def ./rotations.xfm ./grid.mnc
$ vim ./grid.xfm    # write an xfm for the deformation field

$ mincinfo ./grid.mnc
    dimension name         length         step        start
    --------------         ------         ----        -----
    xspace                    100            1          -50
    yspace                    100            1          -50
    zspace                    100            1          -50
    vector_dimension            3      unknown      unknown

$ make_phantom -xstart -50 -ystart -50 -zstart -50 -xstep 1 -ystep 1 -zstep
1 -xnelements 100 -ynelements 100 -znelements 100 ./phantom.mnc -xcenter 0
-ycenter 0 -zcenter 0

$ mincresample -transformation ./grid.xfm phantom.mnc phantom_rotated.mnc
-use_input_sampling


Here is the phantom, and the rotated phantom:

https://drive.google.com/file/d/0BzcZlhs8X1gFZkZuSUtWRkFxcHM/view?usp=sharing


Best,
Andrew



On Thu, Mar 3, 2016 at 12:38 AM, Andrew Janke <a.janke at gmail.com> wrote:

> Hi Andrew,
>
> This should be fine for xfm2def, which component of the vector field
> are you viewing in register? X?  The use case you describe is exactly
> what it was written for.
>
> You generally have to specify a large number of input parameters to
> xfm2def (start, step, nelem) in order to get what you want output.  I
> thought there was a version floating around in which I implemented a
> -like option but a quick search would say that I'm wrong.
>
>
> a
>
>
> On 3 March 2016 at 15:14, Andrew Wood <andrew at biospective.com> wrote:
> > Hi again,
> >
> > I managed to build xfm2def (I'll issue a small pull request to update for
> > VIO), but I'm not sure what to make of it's behaviour. I'm trying to use
> it
> > to approximate a linear transform as a deformation grid.
> >
> > I ran xfm2def on a "-rotations 30 30 30" xfm, then used it in
> mincresample
> > to rotate a make_phantom volume (grid and phantom sampled like each
> other).
> > Here's the result:
> >
> >
> https://drive.google.com/file/d/0BzcZlhs8X1gFWUNQa2RMd3o3dTg/view?usp=sharing
> >
> > Are there limitations in xfm2def that would prevent it from
> approximating a
> > linear transform like this?
> >
> > Thanks,
> > Andrew
> >
> > On Wed, Mar 2, 2016 at 11:38 PM, Andrew Wood <andrew at biospective.com>
> wrote:
> >
> >>
> >> Hi all,
> >>
> >> It looks like minctools isn't currently configured to build xfm2def. I
> >> tried adding it to the CMakeLists.txt, but I'm getting errors:
> >>
> >> minc-toolkit-v2/minctools/progs/xfm/xfm2def.c: In function ‘main’:
> >> minc-toolkit-v2/minctools/progs/xfm/xfm2def.c:96:4: error: unknown type
> >> name ‘progress_struct’
> >>     progress_struct progress;
> >>     ^
> >> ...
> >>
> >> Is there a reason that it's not part of the standard build? If not, is
> >> there an easy way to add it? Or will it require development to bring it
> in
> >> line with the latest version of the libraries?
> >>
> >> Thanks,
> >> Andrew
> >>
> > _______________________________________________
> > MINC-users at bic.mni.mcgill.ca
> > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users
> _______________________________________________
> 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