10#if !defined(__costfns_h)
13#include "newimageall.h"
17 enum costfns { Woods, CorrRatio, MutualInfo, NormCorr, NormMI, LeastSq, LabelDiff,
18 NormCorrSinc, BBR, Unknown };
20 costfns costfn_type(
const std::string& cname);
32 mutable volume4D<float> debugvol;
33 NEWMAT::ColumnVector testCog;
37 NEWMAT::ColumnVector plnp;
52 NEWMAT::Matrix bbr_pts;
53 NEWMAT::Matrix bbr_norms;
76 void set_debug_mode(
bool debug_flag=
true);
77 void set_costfn(
const costfns& costtype) { p_costtype = costtype; }
78 costfns get_costfn(
void) {
return p_costtype; }
79 void set_no_bins(
int n_bins);
81 int set_bbr_coords(
const NEWMAT::Matrix& coords,
const NEWMAT::Matrix& norms);
82 int set_bbr_type(
const std::string& typenm);
83 int set_bbr_step(
int step);
84 int set_bbr_slope(
float slope);
85 int set_bbr_fmap(
const volume<float>& fieldmap,
int phase_encode_direction);
87 int count()
const {
return p_count; }
90 float cost(
const NEWMAT::Matrix& affmat)
const;
92 float cost(
const NEWMAT::Matrix& affmat,
const NEWMAT::ColumnVector& nonlin_params)
const;
94 float cost(
const volume4D<float>& warp)
const;
95 float cost_gradient(volume4D<float>& gradvec,
96 const volume4D<float>& warp,
bool nullbc)
const;
99 float ref_entropy(
const NEWMAT::Matrix& aff)
const;
100 float test_entropy(
const NEWMAT::Matrix& aff)
const;
101 float joint_entropy(
const NEWMAT::Matrix& aff)
const;
103 volume<float> image_mapper(
const NEWMAT::Matrix& affmat)
const;
104 NEWMAT::Matrix mappingfn(
const NEWMAT::Matrix& affmat)
const;
105 float get_bin_intensity(
int bin_number)
const;
106 float get_bin_number(
float intensity)
const;
107 bool is_bbr_set(
void)
const;
110 float bbr_resamp(
const NEWMAT::Matrix& aff,
const NEWMAT::ColumnVector& nonlin_params,
volume<float>& resampvol)
const;
119 float normcorr(
const NEWMAT::Matrix& aff)
const;
120 float normcorr_smoothed(
const NEWMAT::Matrix& aff)
const;
121 float normcorr_smoothed_sinc(
const NEWMAT::Matrix& aff)
const;
122 float normcorr_fully_weighted(
const NEWMAT::Matrix& aff,
126 float leastsquares(
const NEWMAT::Matrix& aff)
const;
127 float leastsquares_smoothed(
const NEWMAT::Matrix& aff)
const;
128 float leastsquares_fully_weighted(
const NEWMAT::Matrix& aff,
132 float labeldiff(
const NEWMAT::Matrix& aff)
const;
133 float labeldiff_smoothed(
const NEWMAT::Matrix& aff)
const;
134 float labeldiff_fully_weighted(
const NEWMAT::Matrix& aff,
138 float bbr(
const NEWMAT::Matrix& aff)
const;
139 float bbr(
const NEWMAT::Matrix& aff,
const NEWMAT::ColumnVector& nonlin_params)
const;
140 float bbr(
const NEWMAT::Matrix& aff,
const NEWMAT::ColumnVector& nonlin_params,
142 float fmap_extrap(
const double& x_vox,
const double& y_vox,
const double& z_vox,
const NEWMAT::ColumnVector& v_pe)
const;
143 int vox_coord_calc(NEWMAT::ColumnVector& tvc, NEWMAT::ColumnVector& rvc,
const NEWMAT::Matrix& aff,
const NEWMAT::ColumnVector& nonlin_params,
144 const NEWMAT::Matrix& iaffbig,
const NEWMAT::Matrix& mm2vox,
const NEWMAT::ColumnVector& pe_dir_vec)
const;
146 float woods_fn(
const NEWMAT::Matrix& aff)
const;
147 float woods_fn_smoothed(
const NEWMAT::Matrix& aff)
const;
149 float corr_ratio(
const NEWMAT::Matrix& aff)
const;
150 float corr_ratio_smoothed(
const NEWMAT::Matrix& aff)
const;
151 float corr_ratio_fully_weighted(
const NEWMAT::Matrix& aff,
154 float corr_ratio_fully_weighted(
const volume4D<float>& warpvol,
157 float corr_ratio_gradient_fully_weighted(volume4D<float>& gradvec,
158 const volume4D<float>& warpvol,
163 float mutual_info(
const NEWMAT::Matrix& aff)
const;
164 float mutual_info_smoothed(
const NEWMAT::Matrix& aff)
const;
165 float mutual_info_fully_weighted(
const NEWMAT::Matrix& aff,
169 float normalised_mutual_info(
const NEWMAT::Matrix& aff)
const;
170 float normalised_mutual_info_smoothed(
const NEWMAT::Matrix& aff)
const;
171 float normalised_mutual_info_fully_weighted(
const NEWMAT::Matrix& aff,
175 float cost(
const NEWMAT::Matrix& affmat,
179 float cost(
const NEWMAT::Matrix& affmat,
180 const NEWMAT::ColumnVector& nonlin_params,
184 float cost(
const volume4D<float>& warp,
188 float cost_gradient(volume4D<float>& gradvec,
189 const volume4D<float>& warp,
192 bool nullbc=
false)
const;
195 NEWMAT::Matrix& mappingfn,
200 int *bindex,
const NEWMAT::Matrix& aff,
201 const int no_bins,
const float smoothsize)
const;
Definition: newimage.h:100