Skip to content

Commit

Permalink
Changes default displacement values for excluded image-frames
Browse files Browse the repository at this point in the history
was 0, now -1 if image-frame excluded or no overlap with masked region

also cleans up displacement related debug logging statements
  • Loading branch information
Joshua van Amerom committed Nov 16, 2017
1 parent 06dbdd1 commit 42084ad
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
15 changes: 7 additions & 8 deletions packages/segmentation/applications/reconstructionCardiac.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1334,25 +1334,24 @@ int main(int argc, char **argv)

// Calculate Displacements Relative to Alignment
mean_displacement.push_back(reconstruction.CalculateDisplacement(transformation_recon_to_ref));
if (debug)
cout<<"Mean Displacement (iter "<<iter<<") = "<<mean_displacement[iter]<<" mm."<<endl;
mean_weighted_displacement.push_back(reconstruction.CalculateWeightedDisplacement(transformation_recon_to_ref));
if (debug)
cout<<"Mean Weighted Displacement (iter "<<iter<<") = "<<mean_weighted_displacement[iter]<<" mm."<<endl;

}
else {

// Calculate Displacement
mean_displacement.push_back(reconstruction.CalculateDisplacement());
if (debug)
cout<<"Mean Displacement (iter "<<iter<<") = "<<mean_displacement[iter]<<" mm."<<endl;
mean_weighted_displacement.push_back(reconstruction.CalculateWeightedDisplacement());
if (debug)
cout<<"Mean Weighted Displacement (iter "<<iter<<") = "<<mean_weighted_displacement[iter]<<" mm."<<endl;

}

// Display Displacements and TRE
if (debug) {
cout<<"Mean Displacement (iter "<<iter<<") = "<<mean_displacement[iter]<<" mm."<<endl;
cout<<"Mean Weighted Displacement (iter "<<iter<<") = "<<mean_weighted_displacement[iter]<<" mm."<<endl;
}

// Save Info for Iteration
if(debug)
{
cout<<"SlicesInfoCardiac4D"<<endl;
Expand Down
8 changes: 4 additions & 4 deletions packages/segmentation/src/irtkReconstructionCardiac4D.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2031,7 +2031,7 @@ double irtkReconstructionCardiac4D::CalculateDisplacement()

disp_sum_slice = 0;
num_voxel_slice = 0;
slice_disp = 0;
slice_disp = -1;
tx_slice = 0;
ty_slice = 0;
tz_slice = 0;
Expand Down Expand Up @@ -2077,7 +2077,7 @@ double irtkReconstructionCardiac4D::CalculateDisplacement()
if (num_voxel_total>0)
mean_disp = disp_sum_total / num_voxel_total;
else
mean_disp = 0;
mean_disp = -1;

return mean_disp;

Expand Down Expand Up @@ -2137,7 +2137,7 @@ double irtkReconstructionCardiac4D::CalculateWeightedDisplacement()

disp_sum_slice = 0;
weight_slice = 0;
slice_disp = 0;
slice_disp = -1;

if (_slice_excluded[inputIndex]==0) {
for (int i = 0; i < _slices[inputIndex].GetX(); i++) {
Expand Down Expand Up @@ -2168,7 +2168,7 @@ double irtkReconstructionCardiac4D::CalculateWeightedDisplacement()
if (weight_total>0)
mean_disp = disp_sum_total / weight_total;
else
mean_disp = 0;
mean_disp = -1;

return mean_disp;

Expand Down

0 comments on commit 42084ad

Please sign in to comment.