suever / pydicom-experimental

pydicom test
0 stars 1 forks source link

InvalidDicomError with this file: little known about this file. #99

Closed suever closed 9 years ago

suever commented 9 years ago

From ThomasBallinger on February 19, 2011 09:50:37

calling dicom.read_file(thisfile) causes InvalidDicomError: The specified file is not a valid DICOM file.

I need to convert some image data to the convenient format of my choice (in this case, my lab needs this in NRRD format) and found fetchDICOM and pydicom couldn't read it. I played with the bits to get the image data I need, but thought it might be helpful for others (as well as myself of course) if this were readable.

I'm not 100% confident that I have anonymized all identifying data, so I'd prefer not to post it here at this point. Perhaps I could email it to someone and they could confirm that I've correctly anonymized the file? Because I can't properly read the header and my knowledge of dicom headers is pretty limited, I don't know if there are some fields stored with an encoding I couldn't find to edit out.

Original issue: http://code.google.com/p/pydicom/issues/detail?id=99

suever commented 9 years ago

From darcymason@gmail.com on February 19, 2011 07:51:54

Have you tried the "force=True" argument to read_file()? It was added more recently, but I don't think the documentation was updated.

suever commented 9 years ago

From darcymason@gmail.com on February 19, 2011 07:52:21

Issue 100 has been merged into this issue.

suever commented 9 years ago

From ThomasBallinger on February 19, 2011 08:02:40

Nice, wasn't aware of that. When using force=True, very little info is found in the header.

In [46]: d=dicom.read_file('case01080_t2.035', force=True)

In [47]: d Out[47]: (4d49, 4647) Private tag data OB: Array of 138968 bytes

We have an in-house tool that shows a lot more information than this: % print-header-mark case01080_t2.030 print_header V1.0 ENTRY AND POSITION ARE 1 1 input_prefix = case01080_t2 output_prefix = suffix = filename_format = %s.%03d patient_name = XXLASTXX,XXFIRSTXX patient_sex = X date = X/XX/XX time_hr_min_sec = XX:XX:XX study_desc = BRAIN series_desc = AXIAL PD/T2 CONVENTIONAL hospital_name = XXLOCATIONXX patient_id = XXXXXX exam_modality = MR image_type_text = genesis image_type = N/A sop_instance_uid = N/A etc...

where X's are censoring I just did. If I just open the file in vim I can find most of this information, but pydicom doesn't seem to.

suever commented 9 years ago

From darcymason@gmail.com on February 19, 2011 08:12:43

Hmmm... it would be hard to offer much more help without a file. Rather than email (not necessarily secure), perhaps you could upload to google docs and email me the link? darcymason gmail (dot) com. Not completely certain how secure that is either, but better at least.

Status: Accepted

suever commented 9 years ago

From darcymason@gmail.com on October 26, 2011 17:29:08

Forgot to update this at the time. File was not valid DICOM. Closing issue.

Status: Invalid