-
-
Notifications
You must be signed in to change notification settings - Fork 44
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
Ultrasound Deidentification - Pixel Masking Failure #165
Comments
Oh interesting, I didn't know about the single frame RGB image. Looking at SamplesPerPixel it notes that:
So would you want to add a check under original.shape == 3 to have different logic depending on this field? If you want to open a PR with this suggested change, it would be great - we want to also have a test case (with a de-identified image) that makes sure it continues to work. |
Sounds good. I'll get started on something. It may take me a bit to get the sample image for upload created and approved. |
If you'd like to take a look at what will be coming, it's committed here. I'm still waiting for a greyscale cine clip to test with and still waiting for images that I can contribute to the project. Once I have these, I'll commit and open the pull request. |
* Correcting issue with deidentifying pixels on RGB images * Correcting issue with deidentifying pixels on cine clips Corrected bugs with "all" keyword. Added additional test methods. * Adding ultrasound test images, handle compressed test images Adding new images to test the variant dimensions that can be encountered when deidentifying pixel data. Introduced the ability to handle zipped test files to bypass the github 100Mb file size limit for the RGB cine clip. Renamed the test file for the pixel dimension tests.
Fixed with #166 |
When deidentifying an ultrasound, an error was encountered when the ultrasound study contained single image RGB stills as well as RGB cine clips. When the study encountered one of these single-image stills, an exception occurred:
This issue appears to be due to an error with clean.py line 223. Since the original shape of the image in this scenario is (X, Y, channel), when using the numpy.tile() function to "stack" the mask into all channels, the mask is incorrectly stacked to a shape of (X, X, Y)
I'm not 100% sure what the correct fix should be for this. If self.original.shape == 4, we have a RGB cine clip - the logic works appropriately. If self.original.shape == 2 we have a single-frame greyscale image - again, the logic works appropriately. However, if self.original.shape == 3, it appears that we are in an ambiguous state. From the comment on line 222, it appears that the intent - as coded - was that in this state we expected to have a greyscale cine clip - which would have the shape of (frames, X, Y). In my error case, however, the file being deidentified, was not a greyscale cine clip, but was instead a single-frame RGB image with the shape (X, Y, channel).
Instead of relying on the shape to indicate the action to take here, I wonder if we should look to the (0028,0002) SamplesPerPixel and (0028,0008) NumberOfFrames tags to determine how to appropriately build the 3 dimensional mask. I'd appreciate other thoughts on this. This is the first I've really had to dig into Ultrasounds.
The text was updated successfully, but these errors were encountered: