- A Dicom Directory cannot have two dicom files with the same SOP Instance UID because the SOP Instance UID should be unique for each file. If you have two different files that have the same SOP Intstance UID then one of them needs to have that value changed.
- Adding structured report to DICOMDIR file gets added as an image means the DirectoryRecordType becomes IMAGE instead of REPORT for that file. Hence, I went for manual creation of DICOMDIR structure but could not add Tags information to RootDirectoryRecord itself. So, if there is any way to add report using AddFile API, it will save my efforts.
- Download dicomdir viewer for free. Photo & Graphics tools downloads - Sante DICOMDIR Viewer by Santesoft and many more programs are available for instant and free download.
- This example shows how to create an image datastore from a collection of DICOM files containing 2-D images. Specify the location of a directory containing 2-D DICOM image files. DicomDir = fullfile (matlabroot, 'toolbox/images/imdata/dog'); Create an imageDatastore, specifying the read function as a handle to the dicomread function.
- The dcmmkdir utility creates a DICOMDIR file from the specified referenced DICOM files according to the DICOM Part 11 Media Storage Application Profiles. Currently the following profiles are supported (others might be added later): General Purpose CD-R Interchange (STD-GEN-CD) General Purpose Interchange on DVD-RAM Media (STD-GEN-DVD-RAM).

- Select a DICOM file (such as *.dcm, *.dcm30, *.dicom).
- Click button 'Convert' to start upload your file.
- Once upload completed, converter will redirect a web page to show the conversion result.
Create and burn DICOM CD/DVD disks from a DICOMDIR file Select the menu command 'CD/DVD BurningCreate DICOM CD/DVD From DICOMDIR'. A dialog box appears and it allows you to select the desired DICOMDIR file. A second dialog box allows you to select the desired series from the contents of the DICOMDIR file.
- If file upload process takes a very long time or no response or very slow, please try to cancel then submit again.
- This converter cannot support encrypted or protected image files.
- If you selected options, be sure to enter valid values.
- If file source is a URL, be sure to enter a complete and valid URL to your file.
- DICOM (Digital Imaging and Communications in Medicine) is an image format for storing medical data, such as CT and MRI scan data, it also contains a lot of useful medical information, such as patient tag, study tag, series tag and image tag. The file extensions can be .dcm, .dcm30, .dicom.
- JPG (JPEG Image) is a lossy image compression format, compression method is usually lossy, based on the discrete cosine transform (DCT), encodings include: Sequential Encoding, Progressive Encoding, Lossless Encoding and Hierarchical Encoding. The file extensions can be .jpg, .jpeg, .jp2.
- DICOM to PDF
PDF (Portable Document Format) - DICOM to GIF
GIF (Graphics Interchange Format)
- PDF to JPG
PDF (Portable Document Format) - BMP to JPG
BMP (Bitmap) - PNG to JPG
PNG (Portable Network Graphics) - GIF to JPG
GIF (Graphics Interchange Format) - TIFF to JPG
TIFF (Tagged Image File Format) - MP4 to JPG
MP4 (MPEG-4 Video) - CR2 to JPG
CR2 (Canon RAW Version 2) - NEF to JPG
NEF (Nikon Electronic Format) - DNG to JPG
DNG (Digital Negative) - PSD to JPG
PSD (Photoshop Document) - CRW to JPG
CRW (Canon Raw Format) - RAW to JPG
RAW (RAW Image) - Canon Raw to JPG
Canon Raw (Canon Camera Raw Image) - Nikon Raw to JPG
Nikon Raw (Nikon Camera Raw Image) - Sony Raw to JPG
Sony Raw (Sony Camera Raw Image) - Pentax Raw to JPG
Pentax Raw (Pentax Camera Raw Image) - Fuji Raw to JPG
Fuji Raw (Fuji Camera Raw Image) - Kodak Raw to JPG
Kodak Raw (Kodak Camera Raw Image) - Panasonic Raw to JPG
Panasonic Raw (Panasonic Camera Raw Image) - Leica Raw to JPG
Leica Raw (Leica Camera Raw Image) - Samsung Raw to JPG
Samsung Raw (Samsung Camera Raw Image) - Sigma Raw to JPG
Sigma Raw (Sigma Camera Raw Image) - Olympus Raw to JPG
Olympus Raw (Olympus Camera Raw Image) - WMF to JPG
WMF (Windows Metafile) - PCX to JPG
PCX (PiCture eXchange) - DJVU to JPG
DjVu (DjVu Image) - EPS to JPG
EPS (Encapsulated PostScript) - DPX to JPG
DPX (Digital Picture Exchange) - CBR to JPG
CBR (Comic Book RAR) - CBZ to JPG
CBZ (Comic Book ZIP) - WEBP to JPG
WEBP (Web Picture) - HEIC to JPG
HEIC (High Efficiency Image Container) - DOCX to JPG
DOCX (Office Open XML Document) - CR3 to JPG
CR3 (Canon RAW Version 3) - ARW to JPG
ARW (Sony Alpha Digital Image) - JFIF to JPG
JFIF (JPEG File Interchange Format) - TGA to JPG
TGA (Truevision Graphics Adapter)
Common pydicom functions called by user code
File Reading/Parsing¶
The main function to read and parse DICOM files using pydicom is dcmread. It is coded in the moduledicom.filereader, but is also imported when the pydicom package is imported:
If you need fine control over the reading, you can either call read_partial or use open_dicom.All are documented below:
pydicom.filereader.dcmread(fp, defer_size=None, stop_before_pixels=False, force=False, specific_tags=None)[source][source]¶Read and parse a DICOM dataset stored in the DICOM File Format.
Read a DICOM dataset stored in accordance with the DICOM File Format(DICOM Standard Part 10 Section 7). If the dataset is not stored inaccordance with the File Format (i.e. the preamble and prefix are missing,there are missing required Type 1 File Meta Information Group elementsor the entire File Meta Information is missing) then you will have toset force to True.
| Parameters: |
|
|---|---|
| Returns: |
|
| Raises: |
|
See also
pydicom.dataset.FileDataset- Data class that is returned.
pydicom.filereader.read_partial- Only read part of a DICOM file, stopping on given conditions.
Examples
Read and return a dataset stored in accordance with the DICOM File Format:
Read and return a dataset not in accordance with the DICOM File Format:
Use within a context manager:
pydicom.filereader.read_partial(fileobj, stop_when=None, defer_size=None, force=False, specific_tags=None)[source][source]¶Parse a DICOM file until a condition is met.
| Parameters: |
|
|---|---|
| Returns: |
|

See also
dcmread- More generic file reading function.
Notes
Use dcmread unless you need to stop on some condition other thanreaching pixel data.
File Writing¶
DICOM files can also be written using pydicom. There are two ways to do this.The first is to use write_file with a prexisting FileDataset (derived from Dataset) instance.The second is to use the save_as method on an Dataset instance.
pydicom.filewriter.write_file(filename, dataset, write_like_original=True)[source]¶Write dataset to the filename specified.
If write_like_original is True then dataset will be written as is(after minimal validation checking) and may or may not contain all or partsof the File Meta Information (and hence may or may not be conformant withthe DICOM File Format).If write_like_original is False, dataset will be stored in the DICOMFile Format in accordance with DICOM Standard Part 10 Section 7. The bytestream of the dataset will be placed into the file after the DICOM FileMeta Information.
| Parameters: |
|
|---|
See also
pydicom.dataset.FileDataset- Dataset class with relevant attributes and information.
pydicom.dataset.Dataset.save_as- Write a DICOM file from a dataset that was read in with dcmread(). save_as wraps dcmwrite.
Dataset.save_as(filename, write_like_original=True)[source][source]¶Create Dicomdir From Dicom Files Download
Write the Dataset to filename.
Saving a Dataset requires that the Dataset.is_implicit_VR andDataset.is_little_endian attributes exist and are set appropriately. IfDataset.file_meta.TransferSyntaxUID is present then it should be set toa consistent value to ensure conformance.
| Parameters: |
|
|---|
See also
pydicom.filewriter.write_dataset- Write a DICOM Dataset to a file.
pydicom.filewriter.write_file_meta_info- Write the DICOM File Meta Information Group elements to a file.
pydicom.filewriter.dcmwrite- Write a DICOM file from a FileDataset instance.
Create Dicomdir From Dicom Files Converter
You can find the complete API documentation for Dataset and otherclasses in the following section.