Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 2 additions & 16 deletions Modules/Core/Common/include/itkImageConstIteratorWithIndex.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,7 @@ ImageConstIteratorWithIndex<TImage>::GoToBegin()
m_Position = m_Begin;
m_PositionIndex = m_BeginIndex;

if (m_Region.GetNumberOfPixels() > 0)
{
m_Remaining = true;
}
else
{
m_Remaining = false;
}
m_Remaining = m_Region.GetNumberOfPixels() > 0;
}

//----------------------------------------------------------------------------
Expand All @@ -154,14 +147,7 @@ ImageConstIteratorWithIndex<TImage>::GoToReverseBegin()
m_PositionIndex[i] = m_EndIndex[i] - 1;
}

if (m_Region.GetNumberOfPixels() > 0)
{
m_Remaining = true;
}
else
{
m_Remaining = false;
}
m_Remaining = m_Region.GetNumberOfPixels() > 0;

// Set the position at the end
const InternalPixelType * buffer = m_Image->GetBufferPointer();
Expand Down
18 changes: 2 additions & 16 deletions Modules/Core/Common/include/itkImageConstIteratorWithOnlyIndex.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,7 @@ ImageConstIteratorWithOnlyIndex<TImage>::GoToBegin()

m_PositionIndex = m_BeginIndex;

if (m_Region.GetNumberOfPixels() > 0)
{
m_Remaining = true;
}
else
{
m_Remaining = false;
}
m_Remaining = m_Region.GetNumberOfPixels() > 0;
}

//----------------------------------------------------------------------------
Expand All @@ -80,14 +73,7 @@ ImageConstIteratorWithOnlyIndex<TImage>::GoToReverseBegin()
m_PositionIndex[i] = m_EndIndex[i] - 1;
}

if (m_Region.GetNumberOfPixels() > 0)
{
m_Remaining = true;
}
else
{
m_Remaining = false;
}
m_Remaining = m_Region.GetNumberOfPixels() > 0;
}

} // end namespace itk
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2148,14 +2148,7 @@ PatchBasedDenoisingImageFilter<TInputImage, TOutputImage>::ComputeGradientJointE
currentPatchVec[jj] = currentPatch.GetPixel(jj, isInBounds);
patchWeightVec[jj].SetSize(m_NumIndependentComponents);
patchWeightVec[jj].Fill(patchWeights[jj]);
if (isInBounds)
{
isInBoundsVec[jj] = true;
}
else
{
isInBoundsVec[jj] = false;
}
isInBoundsVec[jj] = isInBounds;
}

IndexType lastSelectedIdx;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,7 @@ BSplineControlPointImageFilter<TInputImage, TOutputImage>::SetNumberOfLevels(Arr
itkDebugMacro("Setting m_NumberOfLevels to " << this->m_NumberOfLevels);
itkDebugMacro("Setting m_MaximumNumberOfLevels to " << this->m_MaximumNumberOfLevels);

if (this->m_MaximumNumberOfLevels > 1)
{
this->m_DoMultilevel = true;
}
else
{
this->m_DoMultilevel = false;
}
this->m_DoMultilevel = this->m_MaximumNumberOfLevels > 1;
this->SetSplineOrder(this->m_SplineOrder);
this->Modified();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,14 +155,7 @@ BSplineScatteredDataPointSetToImageFilter<TInputPointSet, TOutputImage>::SetNumb
itkDebugMacro("Setting m_NumberOfLevels to " << this->m_NumberOfLevels);
itkDebugMacro("Setting m_MaximumNumberOfLevels to " << this->m_MaximumNumberOfLevels);

if (this->m_MaximumNumberOfLevels > 1)
{
this->m_DoMultilevel = true;
}
else
{
this->m_DoMultilevel = false;
}
this->m_DoMultilevel = this->m_MaximumNumberOfLevels > 1;
this->SetSplineOrder(this->m_SplineOrder);
this->Modified();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1296,14 +1296,7 @@ FlatStructuringElement<VDimension>::FromImage(const ImageType * image)
{
const PixelType & val = image->GetPixel(centerIdx + res.GetOffset(j));
// Neighborhood (therefore PixelType) in FlatStructuringElement is bool
if (val)
{
res[j] = true;
}
else
{
res[j] = false;
}
res[j] = val;
}

return res;
Expand Down
9 changes: 1 addition & 8 deletions Modules/IO/GIPL/src/itkGiplImageIO.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -219,14 +219,7 @@ GiplImageIO::Read(void * buffer)
bool success = false;
if (m_IsCompressed)
{
if (p != nullptr)
{
success = true;
}
else
{
success = false;
}
success = p != nullptr;
}
else
{
Expand Down
20 changes: 3 additions & 17 deletions Modules/IO/MeshOBJ/src/itkOBJMeshIO.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -167,25 +167,11 @@ OBJMeshIO::ReadMeshInformation()

this->m_PointDimension = 3;

// If number of points is not equal zero, update points
if (this->m_NumberOfPoints)
{
this->m_UpdatePoints = true;
}
else
{
this->m_UpdatePoints = false;
}
// If number of points is greater than zero, update points
this->m_UpdatePoints = this->m_NumberOfPoints > 0;
Comment thread
dzenanz marked this conversation as resolved.

// If number of cells is not equal zero, update points
if (this->m_NumberOfCells)
{
this->m_UpdateCells = true;
}
else
{
this->m_UpdateCells = false;
}
this->m_UpdateCells = this->m_NumberOfCells;

// Set default point component type
this->m_PointComponentType = IOComponentEnum::FLOAT;
Expand Down
12 changes: 3 additions & 9 deletions Modules/IO/TIFF/src/itkTIFFReaderInternal.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -262,18 +262,12 @@ TIFFReaderInternal::Initialize()
TIFFGetFieldDefaulted(this->m_Image, TIFFTAG_PLANARCONFIG, &this->m_PlanarConfig);
TIFFGetFieldDefaulted(this->m_Image, TIFFTAG_SAMPLEFORMAT, &this->m_SampleFormat);

// If TIFFGetField returns false, there's no Photometric Interpretation
// If TIFFGetField returns zero, there's no Photometric Interpretation
// set for this image, but that's a required field so we set a warning flag.
// (Because the "Photometrics" field is an enum, we can't rely on setting
// this->m_Photometrics to some signal value.)
if (TIFFGetField(this->m_Image, TIFFTAG_PHOTOMETRIC, &this->m_Photometrics))
{
this->m_HasValidPhotometricInterpretation = true;
}
else
{
this->m_HasValidPhotometricInterpretation = false;
}
this->m_HasValidPhotometricInterpretation =
TIFFGetField(this->m_Image, TIFFTAG_PHOTOMETRIC, &this->m_Photometrics) != 0;
}

return 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -446,14 +446,7 @@ FEMRegistrationFilter<TMovingImage, TFixedImage, TFemObject>::ApplyLoads(ImageSi
++CornerCounter;
}
}
if (CornerCounter == ImageDimension - 1)
{
EdgeFound = true;
}
else
{
EdgeFound = false;
}
EdgeFound = CornerCounter == ImageDimension - 1;
if (EdgeFound)
{
for (unsigned int jj = 0; jj < ndofpernode; ++jj)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,14 +201,7 @@ GPUDemonsRegistrationFilterTestTemplate(int argc, char * argv[])
// std::endl;
// std::cout << "Total CPU time in seconds = " << m_CPUTime.GetMean() <<
// std::endl;
if (avgDiff < 2)
{
passed = true;
}
else
{
passed = false;
}
passed = avgDiff < 2;

if (!passed)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -301,14 +301,7 @@ DeformableSimplexMesh3DGradientConstraintForceFilter<TInputMesh, TOutputMesh>::C

current = new ImageVoxel(vpos, pos, static_cast<double>(m_Image->GetPixel(index)), dist, ++i);
m_Positive.push_back(current);
if (current->GetDistance() > m_Range)
{
stop = true;
}
else
{
stop = false;
}
stop = current->GetDistance() > m_Range;
}
}
}
Expand Down Expand Up @@ -358,14 +351,7 @@ DeformableSimplexMesh3DGradientConstraintForceFilter<TInputMesh, TOutputMesh>::C

current = new ImageVoxel(vpos, pos, static_cast<double>(m_Image->GetPixel(index)), dist, --ii);
m_Negative.push_back(current);
if (current->GetDistance() > m_Range)
{
stop = true;
}
else
{
stop = false;
}
stop = current->GetDistance() > m_Range;
}
}
}
Expand Down
Loading