ENH: add a convenience function WriteImage#2160
ENH: add a convenience function WriteImage#2160hjmjohnson merged 2 commits intoInsightSoftwareConsortium:masterfrom
Conversation
Reduced boilerplate code by calling the convenience function.
816d19b to
fc3c8d1
Compare
|
Please consider placing these procedural methods into a sub-namespace of itk. Also consider just using the std::string methods. C strings can implicitly be converted to std::string. So the raw C ptr is just for efficiency (?), but this a convince function for code that should not be time critical, so the burden of the extra methods out ways the potential enhancement. |
|
It seems to me that the |
|
Good point Brad! I will also wait for review from Niels. Hans merged it too fast. |
I agree. By the way, if the performance penalty of creating an |
Of course, that is why I originally proposed defining the function as a static member function of |
Sorry, I'm just trying to keep the forward momentum. This topic had many discussions and I thought it represented a good step forward. BTW: I agree with the proposed changes to drop |
|
Technically I wouldn't think that an overload for non-const |
|
It looks like the |
|
Without non-const overloads there are compile errors: |
|
Is |
Added `itk::ReadImage<TOutputImage>(const std::string & filename)`, to allows simplifying the C++ code for reading an image. Suggested by Dženan Zukić at InsightSoftwareConsortium#2102 (comment) Follow-up to: "ENH: add a convenience function WriteImage" Pull request: InsightSoftwareConsortium#2160 Commit: 60b0984 Replaced manual creation of `ImageFileReader` objects in Common tests by calls to the new `itk::ReadImage` function. Also removed related redundant try-catch blocks from SymmetricSecondRankTensorImage tests.
Added `itk::ReadImage<TOutputImage>(const std::string & filename)`, to allows simplifying the C++ code for reading an image. Suggested by Dženan Zukić at InsightSoftwareConsortium#2102 (comment) Follow-up to: "ENH: add a convenience function WriteImage" Pull request: InsightSoftwareConsortium#2160 Commit: 60b0984 Replaced manual creation of `ImageFileReader` objects in Common tests by calls to the new `itk::ReadImage` function. Also removed related redundant try-catch blocks from SymmetricSecondRankTensorImage tests.
Added `itk::ReadImage<TOutputImage>(const std::string & filename)`, to allows simplifying the C++ code for reading an image. Suggested by Dženan Zukić at InsightSoftwareConsortium#2102 (comment) Follow-up to: "ENH: add a convenience function WriteImage" Pull request: InsightSoftwareConsortium#2160 Commit: 60b0984 Replaced manual creation of `ImageFileReader` objects in Common tests by calls to the new `itk::ReadImage` function. Also removed related redundant try-catch blocks from SymmetricSecondRankTensorImage tests.
Added `itk::ReadImage<TOutputImage>(const std::string & filename)`, to allows simplifying the C++ code for reading an image. Suggested by Dženan Zukić at InsightSoftwareConsortium#2102 (comment) Follow-up to: "ENH: add a convenience function WriteImage" Pull request: InsightSoftwareConsortium#2160 Commit: 60b0984 Replaced manual creation of `ImageFileReader` objects in Common tests by calls to the new `itk::ReadImage` function. Also removed related redundant try-catch blocks from SymmetricSecondRankTensorImage tests.
Added `itk::ReadImage<TOutputImage>(const std::string & filename)`, to allows simplifying the C++ code for reading an image. Suggested by Dženan Zukić at #2102 (comment) Follow-up to: "ENH: add a convenience function WriteImage" Pull request: #2160 Commit: 60b0984 Replaced manual creation of `ImageFileReader` objects in Common tests by calls to the new `itk::ReadImage` function. Also removed related redundant try-catch blocks from SymmetricSecondRankTensorImage tests.
Follow-up to ITK pull request InsightSoftwareConsortium/ITK#2160 commit InsightSoftwareConsortium/ITK@60b0984 "ENH: add a convenience function WriteImage", merged on 9 December 2020, and included with ITK v5.2rc01.
Follow-up to ITK pull request InsightSoftwareConsortium/ITK#2160 commit InsightSoftwareConsortium/ITK@60b0984 "ENH: add a convenience function WriteImage", merged on 9 December 2020, and included with ITK v5.2rc01.
Added `itk::ReadImage<TOutputImage>(const std::string & filename)`, to allows simplifying the C++ code for reading an image. Suggested by Dženan Zukić at InsightSoftwareConsortium#2102 (comment) Follow-up to: "ENH: add a convenience function WriteImage" Pull request: InsightSoftwareConsortium#2160 Commit: add59ae Replaced manual creation of `ImageFileReader` objects in Common tests by calls to the new `itk::ReadImage` function. Also removed related redundant try-catch blocks from SymmetricSecondRankTensorImage tests.
Inspired by #2102 and dzenanz/ITKMorphologicalContourInterpolation@a9ac128.
PR Checklist