plastimatch
Loading...
Searching...
No Matches
xform.cxx File Reference
#include "plmbase_config.h"
#include <stdlib.h>
#include <string.h>
#include "itkArray.h"
#include "itkResampleImageFilter.h"
#include "itkBSplineResampleImageFunction.h"
#include "itkTransformFileWriter.h"
#include "itkTransformFileReader.h"
#include "bspline_interpolate.h"
#include "bspline_xform.h"
#include "bspline_xform_legacy.h"
#include "file_util.h"
#include "itk_directions.h"
#include "itk_image_create.h"
#include "itk_image_load.h"
#include "itk_image_save.h"
#include "itk_resample.h"
#include "logfile.h"
#include "mha_io.h"
#include "plm_image_header.h"
#include "plm_math.h"
#include "print_and_exit.h"
#include "string_util.h"
#include "volume.h"
#include "volume_header.h"
#include "volume_resample.h"
#include "xform.h"
#include "xform_legacy.h"

Functions

static void itk_bsp_set_grid_img (Xform *xf, const Plm_image_header *pih, const float *grid_spac)
 
static void load_gpuit_bsp (Xform *xf, const char *fn)
 
static void itk_xform_load (Xform *xf, const char *fn)
 
void xform_load (Xform *xf, const char *fn)
 
void xform_load (Xform *xf, const std::string &fn)
 
Xform::Pointer xform_load (const char *fn)
 
Xform::Pointer xform_load (const std::string &fn)
 
template<class T >
static void itk_xform_save (const T transform, const char *filename)
 
void xform_save (Xform *xf, const char *fn)
 
void xform_save (Xform *xf, const std::string &fn)
 
static void init_versor_default (Xform *xf_out)
 
static void init_quaternion_default (Xform *xf_out)
 
static void init_affine_default (Xform *xf_out)
 
static void init_similarity_default (Xform *xf_out)
 
void xform_itk_bsp_init_default (Xform *xf)
 
static void xform_trn_to_vrs (Xform *xf_out, const Xform *xf_in)
 
static void xform_trn_to_aff (Xform *xf_out, const Xform *xf_in)
 
void xform_trn_to_sim (Xform *xf_out, const Xform *xf_in)
 
static void xform_vrs_to_quat (Xform *xf_out, const Xform *xf_in)
 
static void xform_vrs_to_aff (Xform *xf_out, const Xform *xf_in)
 
static void xform_vrs_to_sim (Xform *xf_out, const Xform *xf_in)
 
void xform_sim_to_aff (Xform *xf_out, const Xform *xf_in)
 
static void bsp_grid_from_img_grid (BsplineTransformType::OriginType &bsp_origin, BsplineTransformType::SpacingType &bsp_spacing, BsplineTransformType::RegionType &bsp_region, BsplineTransformType::DirectionType &bsp_direction, const Plm_image_header *pih, const float *grid_spac)
 
static void xform_trn_to_itk_bsp_bulk (Xform *xf_out, const Xform *xf_in, const Plm_image_header *pih, const float *grid_spac)
 
static void xform_vrs_to_itk_bsp_bulk (Xform *xf_out, const Xform *xf_in, const Plm_image_header *pih, const float *grid_spac)
 
static void xform_quat_to_itk_bsp_bulk (Xform *xf_out, const Xform *xf_in, const Plm_image_header *pih, const float *grid_spac)
 
static void xform_aff_to_itk_bsp_bulk (Xform *xf_out, const Xform *xf_in, const Plm_image_header *pih, const float *grid_spac)
 
static void xform_any_to_itk_bsp_nobulk (Xform *xf_out, Xform *xf_in, const Bspline_header *bh)
 
static void xform_any_to_itk_bsp_nobulk (Xform *xf_out, Xform *xf_in, const Plm_image_header *pih, const float *grid_spac)
 
static void itk_bsp_extend_to_region (Xform *xf, const Plm_image_header *pih, const RegionType *roi)
 
static void xform_itk_bsp_to_itk_bsp (Xform *xf_out, const Xform *xf_in, const Plm_image_header *pih, const float *grid_spac)
 
static void gpuit_bsp_grid_to_itk_bsp_grid (BsplineTransformType::OriginType &bsp_origin, BsplineTransformType::SpacingType &bsp_spacing, BsplineTransformType::RegionType &bsp_region, BsplineTransformType::DirectionType &bsp_direction, Bspline_xform *bxf)
 
static void gpuit_bsp_to_itk_bsp_raw (Xform *xf_out, const Xform *xf_in, const Plm_image_header *pih)
 
static void xform_gpuit_bsp_to_itk_bsp (Xform *xf_out, const Xform *xf_in, const Plm_image_header *pih, const float *grid_spac)
 
static DeformationFieldType::Pointer xform_itk_any_to_itk_vf (itk::Transform< double, 3, 3 > *xf, const Plm_image_header *pih)
 
static DeformationFieldType::Pointer xform_itk_bsp_to_itk_vf (Xform *xf_in, const Plm_image_header *pih)
 
static DeformationFieldType::Pointer xform_itk_vf_to_itk_vf (const DeformationFieldType::Pointer &vf, const Plm_image_header *pih)
 
static DeformationFieldType::Pointer xform_gpuit_bsp_to_itk_vf (Xform *xf_in, const Plm_image_header *pih)
 
DeformationFieldType::Pointer xform_gpuit_vf_to_itk_vf (Volume *vf, const Plm_image_header *pih)
 
static Bspline_xformcreate_gpuit_bxf (Plm_image_header *pih, const float *grid_spac)
 
void xform_any_to_gpuit_bsp (Xform *xf_out, Xform *xf_in, Plm_image_header *pih, const float *grid_spac)
 
void xform_gpuit_bsp_to_gpuit_bsp (Xform *xf_out, Xform *xf_in, Plm_image_header *pih, const float *grid_spac)
 
void xform_gpuit_vf_to_gpuit_bsp (Xform *xf_out, Xform *xf_in, Plm_image_header *pih, const float *grid_spac)
 
static Volume::Pointer xform_itk_any_to_gpuit_vf (itk::Transform< double, 3, 3 > *xf, const Plm_image_header *pih)
 
static Volume::Pointer xform_gpuit_vf_to_gpuit_vf (const Volume::Pointer &vf_in, const Plm_image_header *pih)
 
static Volume::Pointer xform_gpuit_bsp_to_gpuit_vf (const Xform *xf_in, const Plm_image_header *pih)
 
Volume::Pointer xform_itk_vf_to_gpuit_vf (DeformationFieldType::Pointer itk_vf, const Plm_image_header *pih)
 
void xform_to_trn (Xform *xf_out, const Xform *xf_in, Plm_image_header *pih)
 
void xform_to_vrs (Xform *xf_out, const Xform *xf_in, Plm_image_header *pih)
 
void xform_to_quat (Xform *xf_out, const Xform *xf_in, Plm_image_header *pih)
 
void xform_to_aff (Xform *xf_out, const Xform *xf_in, Plm_image_header *pih)
 
Xform::Pointer xform_to_aff (const Xform::Pointer &xf_in)
 
void xform_to_similarity (Xform *xf_out, const Xform *xf_in, Plm_image_header *pih)
 
void xform_to_itk_bsp (Xform *xf_out, const Xform *xf_in, Plm_image_header *pih, const float *grid_spac)
 
Xform::Pointer xform_to_itk_bsp (const Xform::Pointer &xf_in, Plm_image_header *pih, const float *grid_spac)
 
void xform_to_itk_bsp_nobulk (Xform *xf_out, Xform *xf_in, Plm_image_header *pih, const float *grid_spac)
 
Xform::Pointer xform_to_itk_bsp_nobulk (const Xform::Pointer &xf_in, Plm_image_header *pih, const float *grid_spac)
 
void xform_to_itk_vf (Xform *xf_out, Xform *xf_in, const Plm_image_header *pih)
 
void xform_to_itk_vf (Xform *xf_out, Xform *xf_in, FloatImageType::Pointer image)
 
Xform::Pointer xform_to_itk_vf (const Xform::Pointer &xf_in, Plm_image_header *pih)
 
void xform_to_gpuit_bsp (Xform *xf_out, Xform *xf_in, Plm_image_header *pih, const float *grid_spac)
 
Xform::Pointer xform_to_gpuit_bsp (const Xform::Pointer &xf_in, Plm_image_header *pih, float *grid_spac)
 
void xform_to_gpuit_vf (Xform *xf_out, const Xform *xf_in, const Plm_image_header *pih)
 
Xform::Pointer xform_to_gpuit_vf (const Xform::Pointer &xf_in, const Plm_image_header *pih)
 

Function Documentation

◆ bsp_grid_from_img_grid()

static void bsp_grid_from_img_grid ( BsplineTransformType::OriginType & bsp_origin,
BsplineTransformType::SpacingType & bsp_spacing,
BsplineTransformType::RegionType & bsp_region,
BsplineTransformType::DirectionType & bsp_direction,
const Plm_image_header * pih,
const float * grid_spac )
static

◆ create_gpuit_bxf()

static Bspline_xform * create_gpuit_bxf ( Plm_image_header * pih,
const float * grid_spac )
static

◆ gpuit_bsp_grid_to_itk_bsp_grid()

static void gpuit_bsp_grid_to_itk_bsp_grid ( BsplineTransformType::OriginType & bsp_origin,
BsplineTransformType::SpacingType & bsp_spacing,
BsplineTransformType::RegionType & bsp_region,
BsplineTransformType::DirectionType & bsp_direction,
Bspline_xform * bxf )
static

◆ gpuit_bsp_to_itk_bsp_raw()

static void gpuit_bsp_to_itk_bsp_raw ( Xform * xf_out,
const Xform * xf_in,
const Plm_image_header * pih )
static

◆ init_affine_default()

static void init_affine_default ( Xform * xf_out)
static

◆ init_quaternion_default()

static void init_quaternion_default ( Xform * xf_out)
static

◆ init_similarity_default()

static void init_similarity_default ( Xform * xf_out)
static

◆ init_versor_default()

static void init_versor_default ( Xform * xf_out)
static

◆ itk_bsp_extend_to_region()

static void itk_bsp_extend_to_region ( Xform * xf,
const Plm_image_header * pih,
const RegionType * roi )
static

◆ itk_bsp_set_grid_img()

static void itk_bsp_set_grid_img ( Xform * xf,
const Plm_image_header * pih,
const float * grid_spac )
static

◆ itk_xform_load()

static void itk_xform_load ( Xform * xf,
const char * fn )
static

◆ itk_xform_save()

template<class T >
static void itk_xform_save ( const T transform,
const char * filename )
static

◆ load_gpuit_bsp()

static void load_gpuit_bsp ( Xform * xf,
const char * fn )
static

◆ xform_aff_to_itk_bsp_bulk()

static void xform_aff_to_itk_bsp_bulk ( Xform * xf_out,
const Xform * xf_in,
const Plm_image_header * pih,
const float * grid_spac )
static

◆ xform_any_to_gpuit_bsp()

void xform_any_to_gpuit_bsp ( Xform * xf_out,
Xform * xf_in,
Plm_image_header * pih,
const float * grid_spac )

◆ xform_any_to_itk_bsp_nobulk() [1/2]

static void xform_any_to_itk_bsp_nobulk ( Xform * xf_out,
Xform * xf_in,
const Bspline_header * bh )
static

◆ xform_any_to_itk_bsp_nobulk() [2/2]

static void xform_any_to_itk_bsp_nobulk ( Xform * xf_out,
Xform * xf_in,
const Plm_image_header * pih,
const float * grid_spac )
static

◆ xform_gpuit_bsp_to_gpuit_bsp()

void xform_gpuit_bsp_to_gpuit_bsp ( Xform * xf_out,
Xform * xf_in,
Plm_image_header * pih,
const float * grid_spac )

◆ xform_gpuit_bsp_to_gpuit_vf()

static Volume::Pointer xform_gpuit_bsp_to_gpuit_vf ( const Xform * xf_in,
const Plm_image_header * pih )
static

◆ xform_gpuit_bsp_to_itk_bsp()

static void xform_gpuit_bsp_to_itk_bsp ( Xform * xf_out,
const Xform * xf_in,
const Plm_image_header * pih,
const float * grid_spac )
static

◆ xform_gpuit_bsp_to_itk_vf()

static DeformationFieldType::Pointer xform_gpuit_bsp_to_itk_vf ( Xform * xf_in,
const Plm_image_header * pih )
static

◆ xform_gpuit_vf_to_gpuit_bsp()

void xform_gpuit_vf_to_gpuit_bsp ( Xform * xf_out,
Xform * xf_in,
Plm_image_header * pih,
const float * grid_spac )

◆ xform_gpuit_vf_to_gpuit_vf()

static Volume::Pointer xform_gpuit_vf_to_gpuit_vf ( const Volume::Pointer & vf_in,
const Plm_image_header * pih )
static

◆ xform_gpuit_vf_to_itk_vf()

DeformationFieldType::Pointer xform_gpuit_vf_to_itk_vf ( Volume * vf,
const Plm_image_header * pih )

◆ xform_itk_any_to_gpuit_vf()

static Volume::Pointer xform_itk_any_to_gpuit_vf ( itk::Transform< double, 3, 3 > * xf,
const Plm_image_header * pih )
static

◆ xform_itk_any_to_itk_vf()

static DeformationFieldType::Pointer xform_itk_any_to_itk_vf ( itk::Transform< double, 3, 3 > * xf,
const Plm_image_header * pih )
static

◆ xform_itk_bsp_init_default()

void xform_itk_bsp_init_default ( Xform * xf)

◆ xform_itk_bsp_to_itk_bsp()

static void xform_itk_bsp_to_itk_bsp ( Xform * xf_out,
const Xform * xf_in,
const Plm_image_header * pih,
const float * grid_spac )
static

◆ xform_itk_bsp_to_itk_vf()

static DeformationFieldType::Pointer xform_itk_bsp_to_itk_vf ( Xform * xf_in,
const Plm_image_header * pih )
static

◆ xform_itk_vf_to_gpuit_vf()

Volume::Pointer xform_itk_vf_to_gpuit_vf ( DeformationFieldType::Pointer itk_vf,
const Plm_image_header * pih )

◆ xform_itk_vf_to_itk_vf()

static DeformationFieldType::Pointer xform_itk_vf_to_itk_vf ( const DeformationFieldType::Pointer & vf,
const Plm_image_header * pih )
static

◆ xform_load() [1/4]

Xform::Pointer xform_load ( const char * fn)

◆ xform_load() [2/4]

Xform::Pointer xform_load ( const std::string & fn)

◆ xform_load() [3/4]

void xform_load ( Xform * xf,
const char * fn )

◆ xform_load() [4/4]

void xform_load ( Xform * xf,
const std::string & fn )

◆ xform_quat_to_itk_bsp_bulk()

static void xform_quat_to_itk_bsp_bulk ( Xform * xf_out,
const Xform * xf_in,
const Plm_image_header * pih,
const float * grid_spac )
static

◆ xform_save() [1/2]

void xform_save ( Xform * xf,
const char * fn )

◆ xform_save() [2/2]

void xform_save ( Xform * xf,
const std::string & fn )

◆ xform_sim_to_aff()

void xform_sim_to_aff ( Xform * xf_out,
const Xform * xf_in )

◆ xform_to_aff() [1/2]

Xform::Pointer xform_to_aff ( const Xform::Pointer & xf_in)

◆ xform_to_aff() [2/2]

void xform_to_aff ( Xform * xf_out,
const Xform * xf_in,
Plm_image_header * pih )

◆ xform_to_gpuit_bsp() [1/2]

Xform::Pointer xform_to_gpuit_bsp ( const Xform::Pointer & xf_in,
Plm_image_header * pih,
float * grid_spac )

◆ xform_to_gpuit_bsp() [2/2]

void xform_to_gpuit_bsp ( Xform * xf_out,
Xform * xf_in,
Plm_image_header * pih,
const float * grid_spac )

◆ xform_to_gpuit_vf() [1/2]

Xform::Pointer xform_to_gpuit_vf ( const Xform::Pointer & xf_in,
const Plm_image_header * pih )

◆ xform_to_gpuit_vf() [2/2]

void xform_to_gpuit_vf ( Xform * xf_out,
const Xform * xf_in,
const Plm_image_header * pih )

◆ xform_to_itk_bsp() [1/2]

Xform::Pointer xform_to_itk_bsp ( const Xform::Pointer & xf_in,
Plm_image_header * pih,
const float * grid_spac )

◆ xform_to_itk_bsp() [2/2]

void xform_to_itk_bsp ( Xform * xf_out,
const Xform * xf_in,
Plm_image_header * pih,
const float * grid_spac )

◆ xform_to_itk_bsp_nobulk() [1/2]

Xform::Pointer xform_to_itk_bsp_nobulk ( const Xform::Pointer & xf_in,
Plm_image_header * pih,
const float * grid_spac )

◆ xform_to_itk_bsp_nobulk() [2/2]

void xform_to_itk_bsp_nobulk ( Xform * xf_out,
Xform * xf_in,
Plm_image_header * pih,
const float * grid_spac )

◆ xform_to_itk_vf() [1/3]

Xform::Pointer xform_to_itk_vf ( const Xform::Pointer & xf_in,
Plm_image_header * pih )

◆ xform_to_itk_vf() [2/3]

void xform_to_itk_vf ( Xform * xf_out,
Xform * xf_in,
const Plm_image_header * pih )

◆ xform_to_itk_vf() [3/3]

void xform_to_itk_vf ( Xform * xf_out,
Xform * xf_in,
FloatImageType::Pointer image )

◆ xform_to_quat()

void xform_to_quat ( Xform * xf_out,
const Xform * xf_in,
Plm_image_header * pih )

◆ xform_to_similarity()

void xform_to_similarity ( Xform * xf_out,
const Xform * xf_in,
Plm_image_header * pih )

◆ xform_to_trn()

void xform_to_trn ( Xform * xf_out,
const Xform * xf_in,
Plm_image_header * pih )

◆ xform_to_vrs()

void xform_to_vrs ( Xform * xf_out,
const Xform * xf_in,
Plm_image_header * pih )

◆ xform_trn_to_aff()

static void xform_trn_to_aff ( Xform * xf_out,
const Xform * xf_in )
static

◆ xform_trn_to_itk_bsp_bulk()

static void xform_trn_to_itk_bsp_bulk ( Xform * xf_out,
const Xform * xf_in,
const Plm_image_header * pih,
const float * grid_spac )
static

◆ xform_trn_to_sim()

void xform_trn_to_sim ( Xform * xf_out,
const Xform * xf_in )

◆ xform_trn_to_vrs()

static void xform_trn_to_vrs ( Xform * xf_out,
const Xform * xf_in )
static

◆ xform_vrs_to_aff()

static void xform_vrs_to_aff ( Xform * xf_out,
const Xform * xf_in )
static

◆ xform_vrs_to_itk_bsp_bulk()

static void xform_vrs_to_itk_bsp_bulk ( Xform * xf_out,
const Xform * xf_in,
const Plm_image_header * pih,
const float * grid_spac )
static

◆ xform_vrs_to_quat()

static void xform_vrs_to_quat ( Xform * xf_out,
const Xform * xf_in )
static

◆ xform_vrs_to_sim()

static void xform_vrs_to_sim ( Xform * xf_out,
const Xform * xf_in )
static