pydicom / deid

best effort anonymization for medical images using python
https://pydicom.github.io/deid/
MIT License
140 stars 43 forks source link

adding support for saving 4d series to single png, or exporting animation #136

Closed vsoch closed 4 years ago

vsoch commented 4 years ago

This PR will address #135, specifically allowing for a user with a 4d timeseries to:

You can reproduce or test this as follows (from ipython)

cd echo/                                                                                                           
from deid.dicom import DicomCleaner                                                                                
client = DicomCleaner()                                                                                            
WARNING No specification, loading default base deid.dicom

client.detect('echo1.dcm')                                                                                         
 {'flagged': True,
 'results': [{'reason': ' SequenceOfUltrasoundRegions present ',
   'group': 'graylist',
   'coordinates': ['231,70,784,657']},
  {'reason': 'and ImageType contains RECONSTRUCTION|SECONDARY|DERIVED',
   'group': 'graylist',
   'coordinates': []},
  {'reason': 'and ImageType contains DERIVED|SECONDARY|SCREEN SAVE|VOLREN|VXTL STATE',
   'group': 'graylist',
   'coordinates': []},
  {'reason': 'and ImageType contains DERIVED|SECONDARY|SCREEN|SAVE',
   'group': 'blacklist',
   'coordinates': []}]}

client.clean()                                                                                                     
Scrubbing echo1.dcm.
WARNING Updating dicom.PhotometricInterpretation to RGB, set fix_interpretation to False to skip.

client.save_animation()                                                                                            
WARNING Selecting channel 0 for rendering
Generating animation...
'/tmp/deid-clean-10_pezq4/cleaned-echo1.mp4'

client.save_png()
nquach commented 4 years ago

Oops my bad, I've been away for the past 3 weeks! Thanks for closing the issue, everything looks good.