@@ -97,37 +97,37 @@ MINCTransformIOTemplate<TParametersValueType>::ReadOneTransform(VIO_General_tran
97
97
parameterArray.SetSize (12 );
98
98
99
99
100
- Matrix<double , 4 , 4 > _affine_transform ;
100
+ Matrix<double , 4 , 4 > affineMatrix ;
101
101
102
- _affine_transform .SetIdentity ();
102
+ affineMatrix .SetIdentity ();
103
103
104
104
// MINC stores transforms in PositiveCoordinateOrientation RAS
105
105
// need to convert to PositiveCoordinateOrientation LPS for ITK
106
- Matrix<double , 4 , 4 > RAS_tofrom_LPS ;
107
- RAS_tofrom_LPS .SetIdentity ();
108
- RAS_tofrom_LPS (0 , 0 ) = -1.0 ;
109
- RAS_tofrom_LPS (1 , 1 ) = -1.0 ;
106
+ Matrix<double , 4 , 4 > RAStofromLPS ;
107
+ RAStofromLPS .SetIdentity ();
108
+ RAStofromLPS (0 , 0 ) = -1.0 ;
109
+ RAStofromLPS (1 , 1 ) = -1.0 ;
110
110
111
111
for (int j = 0 ; j < 3 ; ++j)
112
112
{
113
113
for (int i = 0 ; i < 3 ; ++i)
114
114
{
115
- _affine_transform (i, j) = Transform_elem (*lin, j, i);
115
+ affineMatrix (i, j) = Transform_elem (*lin, j, i);
116
116
}
117
117
// shifts
118
- _affine_transform (3 , j) = Transform_elem (*lin, j, 3 );
118
+ affineMatrix (3 , j) = Transform_elem (*lin, j, 3 );
119
119
}
120
120
121
121
if (this ->m_RAStoLPS ) // flip RAS PositiveCoordinateOrientation to LPS PositiveCoordinateOrientation
122
- _affine_transform = RAS_tofrom_LPS * _affine_transform * RAS_tofrom_LPS ;
122
+ affineMatrix = RAStofromLPS * affineMatrix * RAStofromLPS ;
123
123
124
124
for (int j = 0 ; j < 3 ; ++j)
125
125
{
126
126
for (int i = 0 ; i < 3 ; ++i)
127
127
{
128
- parameterArray.SetElement (i + j * 3 , _affine_transform (i, j));
128
+ parameterArray.SetElement (i + j * 3 , affineMatrix (i, j));
129
129
}
130
- parameterArray.SetElement (j + 9 , _affine_transform (3 , j));
130
+ parameterArray.SetElement (j + 9 , affineMatrix (3 , j));
131
131
}
132
132
133
133
if (xfm->inverse_flag )
@@ -167,7 +167,7 @@ MINCTransformIOTemplate<TParametersValueType>::ReadOneTransform(VIO_General_tran
167
167
using GridImageType = typename DisplacementFieldTransformType::DisplacementFieldType;
168
168
using MincReaderType = ImageFileReader<GridImageType>;
169
169
using OutputPixelType = vnl_vector_fixed<TParametersValueType, 3 >;
170
- const OutputPixelType RAS_tofrom_LPS_vector = { -1 , -1 , 1 };
170
+ const OutputPixelType RAStofromLPSVector = { -1 , -1 , 1 };
171
171
172
172
auto mincIO = MINCImageIO::New ();
173
173
mincIO->SetRAStoLPS (this ->m_RAStoLPS );
@@ -188,13 +188,13 @@ MINCTransformIOTemplate<TParametersValueType>::ReadOneTransform(VIO_General_tran
188
188
itk::MultiThreaderBase::Pointer mt = itk::MultiThreaderBase::New ();
189
189
mt->ParallelizeImageRegion <3 >(
190
190
grid->GetBufferedRegion (),
191
- [grid, LPSgrid, RAS_tofrom_LPS_vector ](const typename GridImageType::RegionType & region) {
191
+ [grid, LPSgrid, RAStofromLPSVector ](const typename GridImageType::RegionType & region) {
192
192
itk::Vector<TParametersValueType, 3 > p;
193
193
itk::ImageRegionConstIterator<GridImageType> iIt (grid, region);
194
194
itk::ImageRegionIterator<GridImageType> oIt (LPSgrid, region);
195
195
for (; !iIt.IsAtEnd (); ++iIt, ++oIt)
196
196
{
197
- p.SetVnlVector (element_product (iIt.Get ().GetVnlVector (), RAS_tofrom_LPS_vector ));
197
+ p.SetVnlVector (element_product (iIt.Get ().GetVnlVector (), RAStofromLPSVector ));
198
198
oIt.Set (p);
199
199
}
200
200
},
@@ -286,34 +286,34 @@ MINCTransformIOTemplate<TParametersValueType>::WriteOneTransform(const int
286
286
287
287
// MINC stores everything in PositiveCoordinateOrientation RAS
288
288
// need to convert from PositiveCoordinateOrientation LPS
289
- Matrix<double , 4 , 4 > RAS_tofrom_LPS ;
290
- Matrix<double , 4 , 4 > _affine_transform ;
289
+ Matrix<double , 4 , 4 > RAStofromLPS ;
290
+ Matrix<double , 4 , 4 > affineMatrix ;
291
291
292
- RAS_tofrom_LPS .SetIdentity ();
293
- RAS_tofrom_LPS (0 , 0 ) = -1.0 ;
294
- RAS_tofrom_LPS (1 , 1 ) = -1.0 ;
295
- _affine_transform .SetIdentity ();
292
+ RAStofromLPS .SetIdentity ();
293
+ RAStofromLPS (0 , 0 ) = -1.0 ;
294
+ RAStofromLPS (1 , 1 ) = -1.0 ;
295
+ affineMatrix .SetIdentity ();
296
296
297
297
298
298
for (int j = 0 ; j < 3 ; ++j)
299
299
{
300
300
for (int i = 0 ; i < 3 ; ++i)
301
301
{
302
- _affine_transform (j, i) = matrix (j, i);
302
+ affineMatrix (j, i) = matrix (j, i);
303
303
}
304
- _affine_transform (3 , j) = offset[j];
304
+ affineMatrix (3 , j) = offset[j];
305
305
}
306
306
307
307
if (this ->m_RAStoLPS )
308
- _affine_transform = RAS_tofrom_LPS * _affine_transform * RAS_tofrom_LPS ;
308
+ affineMatrix = RAStofromLPS * affineMatrix * RAStofromLPS ;
309
309
310
310
for (int j = 0 ; j < 3 ; ++j)
311
311
{
312
312
for (int i = 0 ; i < 3 ; ++i)
313
313
{
314
- Transform_elem (lin, j, i) = _affine_transform (j, i);
314
+ Transform_elem (lin, j, i) = affineMatrix (j, i);
315
315
}
316
- Transform_elem (lin, j, 3 ) = _affine_transform (3 , j);
316
+ Transform_elem (lin, j, 3 ) = affineMatrix (3 , j);
317
317
}
318
318
// add 4th normalization row (not stored)
319
319
Transform_elem (lin, 3 , 3 ) = 1.0 ;
@@ -330,7 +330,7 @@ MINCTransformIOTemplate<TParametersValueType>::WriteOneTransform(const int
330
330
using MincWriterType = ImageFileWriter<GridImageType>;
331
331
typename GridImageType::Pointer grid = GridImageType::New ();
332
332
using OutputPixelType = vnl_vector_fixed<TParametersValueType, 3 >;
333
- const OutputPixelType RAS_tofrom_LPS_vector = { -1 , -1 , 1 };
333
+ const OutputPixelType RAStofromLPSVector = { -1 , -1 , 1 };
334
334
auto * _grid_transform = static_cast <DisplacementFieldTransformType *>(const_cast <TransformType *>(curTransform));
335
335
char tmp[1024 ];
336
336
snprintf (tmp, sizeof (tmp), " %s_grid_%d.mnc" , xfm_file_base, serial);
@@ -361,27 +361,27 @@ MINCTransformIOTemplate<TParametersValueType>::WriteOneTransform(const int
361
361
362
362
if (this ->m_RAStoLPS )
363
363
{
364
- typename GridImageType::Pointer ras_grid = GridImageType::New (); // flipped grid for RAS->LPS conversion
365
- ras_grid ->CopyInformation (grid);
366
- ras_grid ->SetRegions (grid->GetBufferedRegion ());
367
- ras_grid ->Allocate (true );
364
+ typename GridImageType::Pointer rasGrid = GridImageType::New (); // flipped grid for RAS->LPS conversion
365
+ rasGrid ->CopyInformation (grid);
366
+ rasGrid ->SetRegions (grid->GetBufferedRegion ());
367
+ rasGrid ->Allocate (true );
368
368
369
369
itk::MultiThreaderBase::Pointer mt = itk::MultiThreaderBase::New ();
370
370
mt->ParallelizeImageRegion <3 >(
371
371
grid->GetBufferedRegion (),
372
- [grid, ras_grid, RAS_tofrom_LPS_vector ](const typename GridImageType::RegionType & region) {
372
+ [grid, rasGrid, RAStofromLPSVector ](const typename GridImageType::RegionType & region) {
373
373
itk::Vector<TParametersValueType, 3 > p;
374
374
itk::ImageRegionConstIterator<GridImageType> iIt (grid, region);
375
- itk::ImageRegionIterator<GridImageType> oIt (ras_grid , region);
375
+ itk::ImageRegionIterator<GridImageType> oIt (rasGrid , region);
376
376
for (; !iIt.IsAtEnd (); ++iIt, ++oIt)
377
377
{
378
- p.SetVnlVector (element_product (iIt.Get ().GetVnlVector (), RAS_tofrom_LPS_vector ));
378
+ p.SetVnlVector (element_product (iIt.Get ().GetVnlVector (), RAStofromLPSVector ));
379
379
oIt.Set (p);
380
380
}
381
381
},
382
382
nullptr );
383
383
384
- writer->SetInput (ras_grid );
384
+ writer->SetInput (rasGrid );
385
385
}
386
386
else
387
387
{
0 commit comments