Skip to content

ENH: Extend ITKWriteImageFunctionTest by reading the written image back#2203

Merged
hjmjohnson merged 1 commit intoInsightSoftwareConsortium:masterfrom
N-Dekker:ITKWriteImageFunctionTest-reads-image-back
Dec 22, 2020
Merged

ENH: Extend ITKWriteImageFunctionTest by reading the written image back#2203
hjmjohnson merged 1 commit intoInsightSoftwareConsortium:masterfrom
N-Dekker:ITKWriteImageFunctionTest-reads-image-back

Conversation

@N-Dekker
Copy link
Copy Markdown
Contributor

Tests that an image written by itk::WriteImage can be read back,
without loss of data.

Uses two recently added functions:

(operator== is called internally by GoogleTest EXPECT_EQ.)

Tests that an image written by `itk::WriteImage` can be read back,
without loss of data.

Uses two recently added functions:
 - `itk::ReadImage`: pull request InsightSoftwareConsortium#2184 commit aeea88b
 - `operator==` for images: pull request InsightSoftwareConsortium#2188 commit 7f3337d

(`operator==` is called internally by GoogleTest `EXPECT_EQ`.)
@N-Dekker N-Dekker requested a review from blowekamp December 22, 2020 17:23
@N-Dekker
Copy link
Copy Markdown
Contributor Author

Extended Bradley's unit test to check WYWIWYR: What You Write Is What You Read 😸

Comment thread Modules/IO/ImageBase/test/itkWriteImageFunctionGTest.cxx
Copy link
Copy Markdown
Member

@blowekamp blowekamp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks nice.

Just an FYI: The MHA headers encode some of the meta data number as text. The reading and writing cycle can be lossy for non-trivial values.

@N-Dekker N-Dekker marked this pull request as ready for review December 22, 2020 19:56
@N-Dekker
Copy link
Copy Markdown
Contributor Author

Just an FYI: The MHA headers encode some of the meta data number as text. The reading and writing cycle can be lossy for non-trivial values.

@blowekamp Thanks for reminding me that this image ==> WriteImage ==> ReadImage ==> image "round-trip" isn't always 100% lossless! Fortunately, at least, in ITKWriteImageFunctionTest it is 😃

@hjmjohnson hjmjohnson merged commit 21cf648 into InsightSoftwareConsortium:master Dec 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants