Skip to content

Commit

Permalink
Add check for valid points after downsampling
Browse files Browse the repository at this point in the history
  • Loading branch information
spinicist committed May 12, 2023
1 parent d3fc6fe commit 7b571bd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/cmd/downsamp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ int main_downsamp(args::Subparser &parser)
writer.writeTensor(HD5::Keys::Noncartesian, ks2.dimensions(), ks2.data());

return EXIT_SUCCESS;
}
}
3 changes: 3 additions & 0 deletions src/trajectory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ auto Trajectory::downsample(float const res, Index const lores, bool const shrin
}
}
}
if (minSamp > maxSamp) {
Log::Fail("No valid trajectory points remain after downsampling");
}
Index const dsSamples = maxSamp + 1 - minSamp;
Log::Print(
"Downsample res {} mm, factor {}, matrix {}, voxel-size {} mm, read-points {}-{}{}",
Expand Down

0 comments on commit 7b571bd

Please sign in to comment.