Maybe that would be the first way to approach it in pydicom as well - pass a file path or a list of files and then produce it from that, rather than trying to set up general code to create everything after user code has modified DirectroryRecordSequence. Unfortunately, the DICOMDIR structure is an outlier in DICOM formats, with the way it uses offsets to file locations.Īs to other tools, I imagine dcmtk or others could parse a directory and produce a DICOMDIR file for you, so you could get a correct DICOMDIR file if you already have removed the files. logically, the main object has no 'header' as such, being merely a list of attributes, including the pixel data). I can't think of any way to do it in pydicom, other than new code which parses through the DirectoryRecordSequence and updates offsets, but that would have to be done on writing, to know what the offsets actually are. A DICOM data object consists of a number of attributes, including items such as name, ID, etc., and also one special attribute containing the image pixel data (i.e. Slightly OT: Would you be able to recommend a different way (be it a method for pydicom or another tool altogether) to strip patients from a DICOMDIR that doesn't require one to manually adjust the sequence and its offsets?
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
February 2023
Categories |