99 Copyright (c) Insight Software Consortium. All rights reserved.
1010 See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
1111
12- This software is distributed WITHOUT ANY WARRANTY; without even
13- the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12+ This software is distributed WITHOUT ANY WARRANTY; without even
13+ the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
1414 PURPOSE. See the above copyright notices for more information.
1515
1616=========================================================================*/
@@ -50,18 +50,13 @@ ImageRegistrationMethod<TFixedImage,TMovingImage>
5050 m_FixedImageRegionDefined = false ;
5151
5252
53- TransformOutputPointer transformDecorator =
54- static_cast < TransformOutputType * >(
53+ TransformOutputPointer transformDecorator =
54+ static_cast < TransformOutputType * >(
5555 this ->MakeOutput (0 ).GetPointer () );
5656
5757 this ->ProcessObject ::SetNthOutput ( 0 , transformDecorator.GetPointer () );
5858
59- #ifdef ITK_USE_OPTIMIZED_REGISTRATION_METHODS
6059 this ->SetNumberOfThreads ( this ->GetMultiThreader ()->GetNumberOfThreads () );
61- #else
62- this ->SetNumberOfThreads ( 1 );
63- this ->GetMultiThreader ()->SetNumberOfThreads ( this ->GetNumberOfThreads () );
64- #endif
6560}
6661
6762
@@ -79,7 +74,7 @@ ImageRegistrationMethod<TFixedImage,TMovingImage>
7974
8075 // Some of the following should be removed once ivars are put in the
8176 // input and output lists
82-
77+
8378 if (m_Transform)
8479 {
8580 m = m_Transform->GetMTime ();
@@ -117,7 +112,7 @@ ImageRegistrationMethod<TFixedImage,TMovingImage>
117112 }
118113
119114 return mtime;
120-
115+
121116}
122117
123118/*
@@ -141,15 +136,15 @@ template < typename TFixedImage, typename TMovingImage >
141136void
142137ImageRegistrationMethod<TFixedImage,TMovingImage>
143138::SetFixedImageRegion ( const FixedImageRegionType & region )
144- {
139+ {
145140 m_FixedImageRegion = region;
146141 m_FixedImageRegionDefined = true ;
147142 this ->Modified ();
148143}
149144
150145
151146/* *
152- * Initialize by setting the interconnects between components.
147+ * Initialize by setting the interconnects between components.
153148 */
154149template < typename TFixedImage, typename TMovingImage >
155150void
@@ -185,22 +180,19 @@ ImageRegistrationMethod<TFixedImage,TMovingImage>
185180 //
186181 // Connect the transform to the Decorator.
187182 //
188- TransformOutputType * transformOutput =
183+ TransformOutputType * transformOutput =
189184 static_cast < TransformOutputType * >( this ->ProcessObject ::GetOutput (0 ) );
190185
191186 transformOutput->Set ( m_Transform.GetPointer () );
192187
193-
194188 if ( !m_Interpolator )
195189 {
196190 itkExceptionMacro (<<" Interpolator is not present" );
197191 }
198192
199193 // Setup the metric
200- #ifdef ITK_USE_OPTIMIZED_REGISTRATION_METHODS
201194 this ->GetMultiThreader ()->SetNumberOfThreads ( this ->GetNumberOfThreads () );
202195 this ->m_Metric ->SetNumberOfThreads ( this ->GetNumberOfThreads () );
203- #endif
204196 m_Metric->SetMovingImage ( m_MovingImage );
205197 m_Metric->SetFixedImage ( m_FixedImage );
206198 m_Metric->SetTransform ( m_Transform );
@@ -221,7 +213,7 @@ ImageRegistrationMethod<TFixedImage,TMovingImage>
221213 m_Optimizer->SetCostFunction ( m_Metric );
222214
223215 // Validate initial transform parameters
224- if ( m_InitialTransformParameters.Size () !=
216+ if ( m_InitialTransformParameters.Size () !=
225217 m_Transform->GetNumberOfParameters () )
226218 {
227219 itkExceptionMacro (<<" Size mismatch between initial parameters and transform." <<
@@ -241,7 +233,7 @@ template < typename TFixedImage, typename TMovingImage >
241233void
242234ImageRegistrationMethod<TFixedImage,TMovingImage>
243235::StartRegistration ( void )
244- {
236+ {
245237
246238 // StartRegistration is an old API from before
247239 // ImageRegistrationMethod was a subclass of ProcessObject.
@@ -252,7 +244,7 @@ ImageRegistrationMethod<TFixedImage,TMovingImage>
252244 //
253245 // Since we cannot eliminate StartRegistration for backward
254246 // compability reasons, we check whether StartRegistration was
255- // called directly or whether Update() (which in turn called
247+ // called directly or whether Update() (which in turn called
256248 // StartRegistration()).
257249 if (!m_Updating)
258250 {
@@ -270,11 +262,11 @@ ImageRegistrationMethod<TFixedImage,TMovingImage>
270262 catch ( ExceptionObject& err )
271263 {
272264 m_LastTransformParameters = empty;
273-
265+
274266 // pass exception to caller
275267 throw err;
276268 }
277-
269+
278270 this ->StartOptimization ();
279271 }
280272}
@@ -287,7 +279,7 @@ template < typename TFixedImage, typename TMovingImage >
287279void
288280ImageRegistrationMethod<TFixedImage,TMovingImage>
289281::StartOptimization ( void )
290- {
282+ {
291283
292284 try
293285 {
@@ -372,41 +364,41 @@ ImageRegistrationMethod<TFixedImage,TMovingImage>
372364
373365
374366template < typename TFixedImage, typename TMovingImage >
375- void
367+ void
376368ImageRegistrationMethod<TFixedImage,TMovingImage>
377369::SetFixedImage ( const FixedImageType * fixedImage )
378370{
379- itkDebugMacro (" setting Fixed Image to " << fixedImage );
371+ itkDebugMacro (" setting Fixed Image to " << fixedImage );
380372
381- if (this ->m_FixedImage .GetPointer () != fixedImage )
382- {
373+ if (this ->m_FixedImage .GetPointer () != fixedImage )
374+ {
383375 this ->m_FixedImage = fixedImage;
384376
385377 // Process object is not const-correct so the const_cast is required here
386- this ->ProcessObject ::SetNthInput (0 ,
378+ this ->ProcessObject ::SetNthInput (0 ,
387379 const_cast < FixedImageType *>( fixedImage ) );
388-
389- this ->Modified ();
390- }
380+
381+ this ->Modified ();
382+ }
391383}
392384
393385template < typename TFixedImage, typename TMovingImage >
394- void
386+ void
395387ImageRegistrationMethod<TFixedImage,TMovingImage>
396388::SetMovingImage ( const MovingImageType * movingImage )
397389{
398- itkDebugMacro (" setting Moving Image to " << movingImage );
390+ itkDebugMacro (" setting Moving Image to " << movingImage );
399391
400- if (this ->m_MovingImage .GetPointer () != movingImage )
401- {
392+ if (this ->m_MovingImage .GetPointer () != movingImage )
393+ {
402394 this ->m_MovingImage = movingImage;
403395
404396 // Process object is not const-correct so the const_cast is required here
405- this ->ProcessObject ::SetNthInput (1 ,
397+ this ->ProcessObject ::SetNthInput (1 ,
406398 const_cast < MovingImageType *>( movingImage ) );
407-
408- this ->Modified ();
409- }
399+
400+ this ->Modified ();
401+ }
410402}
411403
412404} // end namespace itk
0 commit comments