Skip to content

Commit 8862e35

Browse files
authored
Merge pull request #63 from dzenanz/master
COMP: update to new threading infrastructure and other minor fixes
2 parents cdb06c0 + 91480dc commit 8862e35

File tree

7 files changed

+9
-9
lines changed
  • src
    • Core
    • Filtering/ImageIntensity/ApplyAtanImageFilter
    • Registration/Metricsv4/PerformRegistrationOnVectorImages

7 files changed

+9
-9
lines changed

src/Core/Common/ApplyAFilterOnlyToASpecifiedRegionOfAnImage/Code.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ int main(int, char *[])
4040

4141
using RandomSourceType = itk::RandomImageSource<ImageType>;
4242
RandomSourceType::Pointer randomImageSource = RandomSourceType::New();
43-
randomImageSource->SetNumberOfThreads(1); // to produce non-random results
43+
randomImageSource->SetNumberOfWorkUnits(1); // to produce non-random results
4444
randomImageSource->SetSize(bigSize);
4545
randomImageSource->GetOutput()->SetRequestedRegion(smallSize);
4646

src/Core/Common/DoDataParallelThreading/Code.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ class ComputeCellCountThreader :
101101
// on the current system. It will also be truncated if, for example, the
102102
// number of cells in the CellContainer is smaller than the number of cores
103103
// available.
104-
const itk::ThreadIdType numberOfThreads = this->GetNumberOfThreadsUsed();
104+
const itk::ThreadIdType numberOfThreads = this->GetNumberOfWorkUnitsUsed();
105105
this->m_CellCountPerThread.resize( numberOfThreads );
106106
for( itk::ThreadIdType ii = 0; ii < numberOfThreads; ++ii )
107107
{
@@ -137,7 +137,7 @@ class ComputeCellCountThreader :
137137
{
138138
// Accumulate the cell counts per thread in the associate's total cell
139139
// count.
140-
const itk::ThreadIdType numberOfThreads = this->GetNumberOfThreadsUsed();
140+
const itk::ThreadIdType numberOfThreads = this->GetNumberOfWorkUnitsUsed();
141141
for( itk::ThreadIdType ii = 0; ii < numberOfThreads; ++ii )
142142
{
143143
this->m_Associate->m_CellCount[NEURON] +=

src/Core/Common/DuplicateAnImage/Code.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ int main(int, char *[])
3030
using RandomSourceType = itk::RandomImageSource< ImageType >;
3131

3232
RandomSourceType::Pointer randomImageSource = RandomSourceType::New();
33-
randomImageSource->SetNumberOfThreads(1); // to produce non-random results
33+
randomImageSource->SetNumberOfWorkUnits(1); // to produce non-random results
3434

3535
ImageType::Pointer image = randomImageSource->GetOutput();
3636

src/Core/Common/FilterAndParallelizeImageRegion/Code.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ int main(int, char *[])
7979
randomImageSource->SetSize(region.GetSize());
8080
// we don't want overflow on 1+x operation, so set max pixel value
8181
randomImageSource->SetMax(itk::NumericTraits< PixelType >::max() - 1);
82-
randomImageSource->SetNumberOfThreads(1); // to produce deterministic results
82+
randomImageSource->SetNumberOfWorkUnits(1); // to produce deterministic results
8383
randomImageSource->Update();
8484

8585
ImageType::Pointer image = randomImageSource->GetOutput();

src/Core/TestKernel/GenerateRandomImage/Code.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ int main(int argc, char* argv[])
4242

4343
RandomImageSourceType::Pointer randomImageSource =
4444
RandomImageSourceType::New();
45-
randomImageSource->SetNumberOfThreads(1); // to produce reproducible results
45+
randomImageSource->SetNumberOfWorkUnits(1); // to produce reproducible results
4646
randomImageSource->SetSize( size );
4747

4848
using WriterType = itk::ImageFileWriter< ImageType >;

src/Filtering/ImageIntensity/ApplyAtanImageFilter/Code.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ int main( int argc, char* argv[] )
4444

4545
RandomImageSourceType::Pointer randomImageSource =
4646
RandomImageSourceType::New();
47-
randomImageSource->SetNumberOfThreads(1); // to produce non-random results
47+
randomImageSource->SetNumberOfWorkUnits(1); // to produce non-random results
4848
randomImageSource->SetSize(size);
4949

5050
using OutputPixelType = float;

src/Registration/Metricsv4/PerformRegistrationOnVectorImages/Code.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ int main(int argc, char *argv[])
151151
++count;
152152
}
153153
metric->SetFixedSampledPointSet( pointSet );
154-
metric->SetUseFixedSampledPointSet( true );
154+
metric->SetUseSampledPointSet( true );
155155

156156

157157
// Assign images and transforms.
@@ -198,7 +198,7 @@ int main(int argc, char *argv[])
198198
// previously computed affine transformation.
199199
compositeTransform->SetOnlyMostRecentTransformToOptimizeOn();
200200
metric->SetMovingTransform( compositeTransform );
201-
metric->SetUseFixedSampledPointSet( false );
201+
metric->SetUseSampledPointSet( false );
202202
metric->Initialize();
203203

204204
// Optimizer

0 commit comments

Comments
 (0)