[MINC-development] mincresample using ftol based on the input file stepsizes

Vladimir S. FONOV vladimir.fonov at gmail.com
Tue Jun 11 16:12:39 EDT 2013


Hello,


can you create pull-requests for libminc and minc-tools - this way we 
can integrate this info into the main github repository

On 13-06-11 03:59 PM, Matthijs Van Eede wrote:
> Greetings!
>
> I was going through my todo list, and saw that there was an issue I wanted to address for a long time which I should really tackle properly. When using mincresample, the error tolerance for determining where a voxel comes from (ftol) is based on the step sizes of the deformation grid used for the resampling. Especially when using animal data, there can be a big difference between that step size and the step size of the actual input file, potentially causing resampling inaccuracies. A possible solution to this is to artificially change the stepsize of the input data (which I remember Andrew saying at some point), but as Jason mentioned, it would be nice to have "normal" sized mouse brains even on the southern hemisphere :-)
>
> In order to do this, mincresample needs to pass along the step size information of the input file being resampled. I've made changes to the libminc and minc-tools repositories from GitHub which I forked from BIC-MNI. For libminc, I worked on Vladimir's develop branch which is used for his minc-toolkit repository. I made changes to the following files:
>
> libminc/volume_io/Include/volume_io/vol_io_prototypes.h
> libminc/volume_io/MNI_formats/gen_xfs.c
> libminc/volume_io/MNI_formats/grid_transforms.c
>
> and
>
> minc-tools/progs/mincresample/mincresample.c
> minc-tools/progs/mincresample/mincresample.h
> minc-tools/progs/mincresample/resample_volumes.c
>
> Here are the specific changes:
>
> https://github.com/mcvaneede/libminc/commit/784f6a01036c2c1d38924eea363e1aa7a0638673
> https://github.com/mcvaneede/minc-tools/commit/89bcfe73b705ebc84d7442cec0cff78aa7217e15
>
> Would it be possible to merge these changes back into the main branch at BIC-MNI?
> Thanks in advance,
> Matthijs
>
> PS The way I addressed this issue overall, is to create two functions out of the original function that needed to pass along the input step size information as follows:
>
> Original function:
> VIOAPI VIO_Status grid_inverse_transform_point(
>      VIO_General_transform *transform,
>      VIO_Real x,
>      VIO_Real y,
>      VIO_Real z,
>      VIO_Real *x_transformed,
>      VIO_Real *y_transformed,
>      VIO_Real *z_transformed )
> {
> ...
> ...
> }
>
> And split it up into the two following (main):
> VIOAPI VIO_Status grid_inverse_transform_point_with_input_steps(
>      VIO_General_transform *transform,
>      VIO_Real x,
>      VIO_Real y,
>      VIO_Real z,
>      VIO_Real *input_volume_steps,
>      VIO_Real *x_transformed,
>      VIO_Real *y_transformed,
>      VIO_Real *z_transformed )
> {
> ...
> ...
> }
>
> and the now "dummy":
>
> VIOAPI VIO_Status grid_inverse_transform_point(
>      VIO_General_transform *transform,
>      VIO_Real x,
>      VIO_Real y,
>      VIO_Real z,
>      VIO_Real *x_transformed,
>      VIO_Real *y_transformed,
>      VIO_Real *z_transformed )
> {
>      return grid_inverse_transform_point_with_input_steps(transform, x, y, z,
>                                             NULL,
>                                             x_transformed, y_transformed, z_transformed );
> }
> _______________________________________________
> MINC-development mailing list
> MINC-development at bic.mni.mcgill.ca
> http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-development
>


-- 
Best regards,

  Vladimir S. FONOV ~ vladimir.fonov <at> gmail.com


More information about the MINC-development mailing list