KCL-BMEIS / niftyreg

This project contains command line tools to perform rigid, affine and non-linear registration of nifti or analyse images as well as utilities
BSD 3-Clause "New" or "Revised" License
141 stars 42 forks source link

niftyreg error #89

Closed nightandweather closed 1 year ago

nightandweather commented 2 years ago

스크린샷 2022-08-24 오후 3 14 22 스크린샷 2022-08-24 오후 5 08 45

Hi, I'm following niftyreg code and registering in my own dataset. can i have advice in this situation?

dataset : 160 160 160 H/N CT images and organ structure

thank you

AXu0511 commented 1 year ago

Hello! Have you solved your problem? I met the same question as you did.

mmodat commented 1 year ago

Quite an old post but replying in case it helps anyone else. reg_transform does not have arguments called ccp2def of def2disp. Instead the type of transformation parametrisation is encoded within the nifti file directly.

The reg_transform options, from the -help argument are as follows:

Usage:  reg_transform [OPTIONS].
* * OPTIONS * *

    -ref <filename>
        Filename of the reference image
        The Reference image has to be specified when a cubic B-Spline parametrised control point grid is used*.
    -ref2 <filename>
        Filename of the second reference image to be used when dealing with composition

    -def <filename1> <filename2>
        Take a transformation of any recognised type* and compute the corresponding deformation field
        filename1 - Input transformation file name
        filename2 - Output deformation field file name

    -disp <filename1> <filename2>
        Take a transformation of any recognised type* and compute the corresponding displacement field
        filename1 - Input transformation file name
        filename2 - Output displacement field file name

    -flow <filename1> <filename2>
        Take a spline parametrised SVF and compute the corresponding flow field
        filename1 - Input transformation file name
        filename2 - Output flow field file name

    -comp <filename1> <filename2> <filename3>
        Compose two transformations of any recognised type* and returns a deformation field.
        Trans3(x) = Trans2(Trans1(x)).
        filename1 - Input transformation 1 file name (associated with -ref if required)
        filename2 - Input transformation 2 file name (associated with -ref2 if required)
        filename3 - Output deformation field file name

    -land <filename1> <filename2> <filename3>
        Apply a transformation to a set of landmark(s).
        Landmarks are encoded in a text file with one landmark position (mm) per line:
            <key1_x> <key1_y> <key1_z>
            <key2_x> <key2_y> <key2_z>
        filename1 - Input transformation file name
        filename2 - Input landmark file name.
        filename3 - Output landmark file name

    -updSform <filename1> <filename2> <filename3>
        Update the sform of an image using an affine transformation.
        Filename1 - Image to be updated
        Filename2 - Affine transformation defined as Affine x Reference = Floating
        Filename3 - Updated image.

    -invAff <filename1> <filename2>
        Invert an affine matrix.
        filename1 - Input affine transformation file name
        filename2 - Output inverted affine transformation file name

    -invNrr <filename1> <filename2> <filename3>
        Invert a non-rigid transformation and save the result as a deformation field.
        filename1 - Input transformation file name
        filename2 - Input floating image where the inverted transformation is defined
        filename3 - Output inverted transformation file name
        Note that the cubic b-spline grid parametrisations can not be inverted without approximation,
        as a result, they are converted into deformation fields before inversion.

    -half <filename1> <filename2>
        The input transformation is halfed and stored using the same transformation type.
        filename1 - Input transformation file name
        filename2 - Output transformation file name

    -makeAff <rx> <ry> <rz> <tx> <ty> <tz> <sx> <sy> <sz> <shx> <shy> <shz> <outputFilename>
        Create an affine transformation matrix

    -aff2rig <filename1> <filename2>
        Extract the rigid component from an affine transformation matrix
        filename1 - Input transformation file name
        filename2 - Output transformation file name

    -flirtAff2NR <filename1> <filename2> <filename3> <filename4>
        Convert a flirt (FSL) affine transformation to a NiftyReg affine transformation
        filename1 - Input FLIRT (FSL) affine transformation file name
        filename2 - Image used as a reference (-ref arg in FLIRT)
        filename3 - Image used as a floating (-in arg in FLIRT)
        filename4 - Output affine transformation file name

    -omp <int>
        Number of thread to use with OpenMP. [32/32]
    --version
        Print current version and exit (1.5.76)

    * The supported transformation types are:
        - cubic B-Spline parametrised grid (reference image is required)
        - a dense deformation field
        - a dense displacement field
        - a cubic B-Spline parametrised stationary velocity field (reference image is required)
        - a stationary velocity deformation field
        - a stationary velocity displacement field
        - an affine matrix

More insight on the transformation parametrisations can be found here: https://github.com/KCL-BMEIS/niftyreg/wiki/transformations