-
-
Notifications
You must be signed in to change notification settings - Fork 686
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
STYLE: Use itk::ReadImage and itk::WriteImage in Examples/Segmentations, SpatialObjects and Statistics #5163
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for contributing a pull request! 🙏
Welcome to the ITK community! 🤗👋☀️
We are glad you are here and appreciate your contribution. Please keep in mind our community participation guidelines. 📜
More support and guidance on the contribution process can be found in our contributing guide. 📖
This is an automatic message. Allow for time for the ITK community to be able to read the pull request and comment
on it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some remarks inline. I took a closer look at the first commit, and a glancing look at the second commit.
reader->SetFileName(argv[1]); | ||
try | ||
{ | ||
const auto input = itk::ReadImage<ImageType>(argv[1]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here the input
has very narrow scope. It is available only between lines 96 and 98.
std::cerr << excp << std::endl; | ||
return EXIT_FAILURE; | ||
} | ||
adaptor->SetImage(input); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this compile? input
is probably out of scope here.
auto reader = ReaderType::New(); | ||
|
||
reader->SetFileName(argv[1]); | ||
try |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before the try
, you probably need to declare ImageType::Pointer input;
.
try | ||
{ | ||
reader->Update(); | ||
const auto input = itk::ReadImage<ImageType>(argv[1]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same scope issue as in Examples/Statistics/ImageHistogram1.cxx
874d488
to
7b17773
Compare
Closes #2802.
PR Checklist