From: pierre gueth Date: Tue, 8 Nov 2011 10:17:55 +0000 (+0100) Subject: added target image translation in gamma index X-Git-Tag: v1.3.0~173^2 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=87226f434fbe4cb47dbbef889b8b6e8279efb983;p=clitk.git added target image translation in gamma index --- diff --git a/tools/clitkGammaIndex.cxx b/tools/clitkGammaIndex.cxx index be0f807..7e5a92e 100644 --- a/tools/clitkGammaIndex.cxx +++ b/tools/clitkGammaIndex.cxx @@ -224,6 +224,17 @@ int main(int argc,char * argv[]) // load reference vtkImageData* reference = loadImage(reference_filename); assert(reference); + + // translate target with arguments values + // reference is translated instead of target so that the output space stay the same as target + { + double reference_origin[3]; + reference->GetOrigin(reference_origin); + reference_origin[0] -= args_info.translation_x_arg; + reference_origin[1] -= args_info.translation_y_arg; + reference_origin[2] -= args_info.translation_z_arg; + reference->SetOrigin(reference_origin); + } // intensity normalisation if (!use_dose_margin) { @@ -246,6 +257,7 @@ int main(int argc,char * argv[]) vtkImageData* target = loadImage(target_filename); assert(target); + // allocate output OutputImageType::Pointer output = OutputImageType::New(); { diff --git a/tools/clitkGammaIndex.ggo b/tools/clitkGammaIndex.ggo index 20c87f9..b41ba75 100644 --- a/tools/clitkGammaIndex.ggo +++ b/tools/clitkGammaIndex.ggo @@ -12,4 +12,7 @@ option "output" o "Output image filename" string yes option "spatial-margin" s "Spatial margin [mm]" double yes option "relative-dose-margin" r "Dose margin relative to max dose in reference [%]" double no option "absolute-dose-margin" d "Absolute dose margin [Gray]" double no +option "translation-x" x "Target relative position x [mm]" double default="0" no +option "translation-y" y "Target relative position y [mm]" double default="0" no +option "translation-z" z "Target relative position z [mm]" double default="0" no