From: Vivien Delmon Date: Mon, 30 May 2011 11:54:45 +0000 (+0200) Subject: Handle panel shift in Backprojection X-Git-Tag: v1.3.0~330^2~2^2~2 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=95ff78f2fbaefa3adebfed8cc553d99af56a40e6;p=clitk.git Handle panel shift in Backprojection Handle panel shift in x and y direction to generate back projected images. --- diff --git a/itk/clitkBackProjectImageFilter.h b/itk/clitkBackProjectImageFilter.h index ebaeffc..7de71a1 100644 --- a/itk/clitkBackProjectImageFilter.h +++ b/itk/clitkBackProjectImageFilter.h @@ -148,6 +148,11 @@ namespace clitk } } + void SetPanelShift(double x, double y) + { + m_PanelShift[0] = x; + m_PanelShift[1] = y; + } // itkSetMacro(IsoCenter, OutputPointType); // itkGetConstReferenceMacro(IsoCenter, OutputPointType) // itkSetMacro( SourceToScreen, double ); @@ -258,6 +263,7 @@ namespace clitk double m_SourceToAxis; OutputPixelType m_EdgePaddingValue; double m_ProjectionAngle; + double m_PanelShift[2]; // Output image info OutputSizeType m_OutputSize; // Size of the output image diff --git a/itk/clitkBackProjectImageFilter.txx b/itk/clitkBackProjectImageFilter.txx index 0e30a9a..befc882 100644 --- a/itk/clitkBackProjectImageFilter.txx +++ b/itk/clitkBackProjectImageFilter.txx @@ -40,6 +40,8 @@ namespace clitk this->m_SourceToAxis = 1000.0; this->m_EdgePaddingValue = itk::NumericTraits::Zero;//density images this->m_RigidTransformMatrix.SetIdentity(); + this->m_PanelShift[0] = 0.; + this->m_PanelShift[1] = 0.; //Parameters for output this->m_OutputSpacing.Fill(1); @@ -334,8 +336,8 @@ namespace clitk //Compute the first input coordinate (invert Y/X) homInputPoint= (m_ProjectionMatrix * homOutputPoint); - iPoint[0]=-homInputPoint[0]/homInputPoint[2]; - iPoint[1]=homInputPoint[1]/homInputPoint[2]; + iPoint[0]=-homInputPoint[0]/homInputPoint[2] + m_PanelShift[0]; + iPoint[1]=homInputPoint[1]/homInputPoint[2] + m_PanelShift[1]; typedef itk::LinearInterpolateImageFunction< InputImageType, double > InterpolatorType; typename InterpolatorType::Pointer interpolator = InterpolatorType::New();