Skip to content

Commit

Permalink
STYLE: Replace bitwise with logical _and_ (&&) on bool retdc variables
Browse files Browse the repository at this point in the history
Encountered by Matt McCormick.
  • Loading branch information
N-Dekker committed Jun 21, 2023
1 parent 97fec1f commit c74c68b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Core/ComponentBaseClasses/elxResamplerBase.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ ResamplerBase<TElastix>::WriteResultImage(OutputImageType * image,
DirectionType originalDirection;
bool retdc = this->GetElastix()->GetOriginalFixedImageDirection(originalDirection);
infoChanger->SetOutputDirection(originalDirection);
infoChanger->SetChangeDirection(retdc & !this->GetElastix()->GetUseDirectionCosines());
infoChanger->SetChangeDirection(retdc && !this->GetElastix()->GetUseDirectionCosines());
infoChanger->SetInput(image);

/** Do the writing. */
Expand Down Expand Up @@ -476,7 +476,7 @@ ResamplerBase<TElastix>::CreateItkResultImage()
DirectionType originalDirection;
bool retdc = this->GetElastix()->GetOriginalFixedImageDirection(originalDirection);
infoChanger->SetOutputDirection(originalDirection);
infoChanger->SetChangeDirection(retdc & !this->GetElastix()->GetUseDirectionCosines());
infoChanger->SetChangeDirection(retdc && !this->GetElastix()->GetUseDirectionCosines());
infoChanger->SetInput(resampleImageFilter.GetOutput());

/** cast the image to the correct output image Type */
Expand Down
2 changes: 1 addition & 1 deletion Core/ComponentBaseClasses/elxTransformBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ class ITK_TEMPLATE_EXPORT TransformBase : public BaseComponentSE<TElastix>
typename FixedImageType::DirectionType originalDirection;
const bool retdc = this->m_Elastix->GetOriginalFixedImageDirection(originalDirection);
infoChanger->SetOutputDirection(originalDirection);
infoChanger->SetChangeDirection(retdc & !this->m_Elastix->GetUseDirectionCosines());
infoChanger->SetChangeDirection(retdc && !this->m_Elastix->GetUseDirectionCosines());
infoChanger->SetInput(image);

return infoChanger;
Expand Down
2 changes: 1 addition & 1 deletion Core/ComponentBaseClasses/elxTransformBase.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -1043,7 +1043,7 @@ TransformBase<TElastix>::GenerateDeformationFieldImage() const -> typename Defor
typename FixedImageType::DirectionType originalDirection;
bool retdc = this->GetElastix()->GetOriginalFixedImageDirection(originalDirection);
infoChanger->SetOutputDirection(originalDirection);
infoChanger->SetChangeDirection(retdc & !this->GetElastix()->GetUseDirectionCosines());
infoChanger->SetChangeDirection(retdc && !this->GetElastix()->GetUseDirectionCosines());
infoChanger->SetInput(defGenerator->GetOutput());

const Configuration & configuration = Deref(Superclass::GetConfiguration());
Expand Down

0 comments on commit c74c68b

Please sign in to comment.