JuliaHealth / DICOM.jl

Julia package for reading and writing DICOM (Digital Imaging and Communications in Medicine) files
MIT License
56 stars 21 forks source link

Add functionality similar to pydicom's skip_pixels #82

Closed felixhorger closed 3 years ago

felixhorger commented 3 years ago

Hi,

I suggest to include functionality like in pydicom, where reading the pixeldata can be skipped.

The use-case I am concerned with:

I have adjusted your code for doing that, let me know what you think.

Cheers, Felix

notZaki commented 3 years ago

Thanks for the suggestion @felixhorger ! I've ran into similar use cases too where reading the entire file is unnecessary---in my case, the scanner dumps all dicom files into a folder, and then I have a script to organize the files into subfolders that are named based on the series number and series description.

There is currently an undocumented feature to only read the dicom file up to a desired tag group. This can be specified by passing an optional keyword argument max_group. For example, dcm_parse(file; max_group = 0x0020) will parse everything including the 0x0020 group and then stop. Does that sound like a reasonable workaround?

felixhorger commented 3 years ago

That is indeed more elegant, thank you! :)

Cheers, Felix