The final desired data structure should look quite familiar: This would be a little bit similar to this example on the contrib-pydicom repository. In terms of implementation, this could be done by subclassing Dataset and passing a list of children objects as an argument during the init call. In the second and third cases, I could loop over these files and add the resulting Dataset objects into their "parent" via the Directory Record Type attribute (which may not be present in some cases) or some other suitable alternative. I can then access particular elements either via their tags or via the "children" attribute. In the first case, I can simply read the dicomdir file with dcmread and obtain the dataset with the correct hierarchy. From these objects I would then extract any tag information, pixel arrays (using the "ReferencedFileID" tag to load them as needed), etc. As such, I would like to automate the data extraction process by first loading all the files corresponding to a given dataset into a Dataset object (or DicomDir object, though I know this will be deprecated) with the desired hierarchy, regardless of the original organization of the files. I figured this was the best place to ask this question, since you are all much more intimately familiar with the package than others may be.īasically, I am working on a project with datasets of varying provenance, and they are not always organized in a consistent manner (flat vs. My question is related to loading datasets into a Patient->Study->Series->Image hierarchy (preferably as a Dataset object) given an arbitrary organization of the corresponding input. I would like to first off by saying that I love working with the pydicom package, and greatly appreciate the work put in by all the contributors!
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |