google-code-export / pydicom

Automatically exported from code.google.com/p/pydicom
0 stars 0 forks source link

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

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
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 reported on code.google.com by ThomasBallinger on 19 Feb 2011 at 2:50

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

Original comment by darcymason@gmail.com on 19 Feb 2011 at 3:51

GoogleCodeExporter commented 9 years ago
Issue 100 has been merged into this issue.

Original comment by darcymason@gmail.com on 19 Feb 2011 at 3:52

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
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 = <none>
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.

Original comment by ThomasBallinger on 19 Feb 2011 at 4:02

GoogleCodeExporter commented 9 years ago
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 <at> gmail (dot) com. Not completely certain how 
secure that is either, but better at least.

Original comment by darcymason@gmail.com on 19 Feb 2011 at 4:12

GoogleCodeExporter commented 9 years ago
Forgot to update this at the time. File was not valid DICOM. Closing issue.

Original comment by darcymason@gmail.com on 27 Oct 2011 at 12:29