Open sh4hri4roo opened 2 years ago
Thank you for reporting. Could you provide an anonymized form of the DICOM file or an abridged dump of the file using another DICOM tool? It would help to understand what really happens in this case. The ParseMetaDataSet
error variant should also contain an informative root source error underneath.
If the file is missing a file meta group entirely, then it needs to be read using separate data set reading functions, such as InMemDicomObject::read_dataset_with_ts
. A best-effort mechanism to infer parts of the file meta table may eventually exist (#50).
If only one of the mandatory fields are missing, such as Media Storage SOP Instance UID, it is true that DICOM-rs shows no recourse at the moment (FWIW that field is mandatory according to the standard). In this case, maybe the object loading options could be extended to set up baseline file meta information, so that it would fill in the necessary gaps in advance.
Here is the output of open_file() function:
let mut obj = open_file("some_path").unwrap();
thread 'main' panicked at 'called Result::unwrap()
on an Err
value: ParseMetaDataSet { source: MissingElement { alias: "MediaStorageSOPInstanceUID", backtrace: Backtrace(()) } }
But as you can see from another Dicom tool, the dicom file actually has the "MediaStorageSOPInstanceUID" element!
1.zip
Odd. dicom-dump
uses open_file
underneath but it could produce a dump of the given file just fine. Can you double check that this is the problematic file, and that you are using the latest version of the library (0.5.0)?
Yes, I'm using the latest version.
OK, the issue can be reproduced with the second example.
The file is clearly missing mandatory fields as per PS3.10 Chapter 7, but it can be made more resilient with the following two changes:
FileMetaTable
expects mandatory fields to always be present, so it will have to be changed so that they also sit behind Option
s. Better coordinate this with #70 too.Until something like the above is implemented, DICOM-rs requires all Type 1 file meta information attributes to be present in a file, even if just placeholders.
thank you
Hi,
@Enet4 I will create a pr for this, as discussed on forum.
I have a Dicom file which does not has "sop_instance_uid" or at least Dicom-rs does not recognize it! I know that there are two ways to read a dicom file but both of them give me "ParseMetaDataSet" error and then I can not go further. Is there any way to somehow add this element to meta table? If so, please provide more information(sample, link to source,...)