@itk-wasm/dicom

Read and write files and images related to DICOM file format.

👨‍💻 Live API Demo ✨



applyPresentationStateToImage readDicomEncapsulatedPdf readImageDicomFileSeries readOverlappingSegmentation readSegmentation structuredReportToHtml structuredReportToText writeMultiSegmentation writeOverlappingSegmentation writeSegmentation Apply a presentation state to a given DICOM image and render output as bitmap, or dicom file.





colorOutput - output image as RGB (default: false)


noPresentationStateOutput - Do not get presentation state information in text stream.

noBitmapOutput - Do not get resulting image as bitmap output stream.


Load sample inputs Run

Download

bmp dcm gipl hdf5 jpg lsm mnc mnc.gz mgh mha mrc nii nii.gz png nrrd png pic tif isq fdf vtk Download

Extract PDF file from DICOM encapsulated PDF.



readFileOnly - read file format only

readDataset - read data set without file meta information

readXferAuto - use TS recognition (default)

readXferDetect - ignore TS specified in the file meta header

readXferLittle - read with explicit VR little endian TS

readXferBig - read with explicit VR big endian TS

readXferImplicit - read with implicit VR little endian TS

acceptOddLength - accept odd length attributes (default)

assumeEvenLength - assume real length is one byte larger

enableCp246 - read undefined len UN as implicit VR (default)

disableCp246 - read undefined len UN as explicit VR

retainUn - retain elements as UN (default)

convertUn - convert to real VR if known

enableCorrection - enable automatic data correction (default)

disableCorrection - disable automatic data correction


Load sample inputs Run

Download

Read a DICOM image series and return the associated image volume



singleSortedSeries - The input files are a single sorted series


Load sample inputs Run

bmp dcm gipl hdf5 jpg lsm mnc mnc.gz mgh mha mrc nii nii.gz png nrrd png pic tif isq fdf vtk Download

Download

Read DICOM segmentation object with overlapping segments into a VectorImage.



mergeSegments - Merge segments into a single image


Load sample inputs Run

bmp dcm gipl hdf5 jpg lsm mnc mnc.gz mgh mha mrc nii nii.gz png nrrd png pic tif isq fdf vtk Download

Download

Read DICOM segmentation objects




Load sample inputs Run

bmp dcm gipl hdf5 jpg lsm mnc mnc.gz mgh mha mrc nii nii.gz png nrrd png pic tif isq fdf vtk Download

Download

Render DICOM SR file and data set to HTML/XHTML



readFileOnly - read file format only

readDataset - read data set without file meta information

readXferAuto - use TS recognition (default)

readXferDetect - ignore TS specified in the file meta header

readXferLittle - read with explicit VR little endian TS

readXferBig - read with explicit VR big endian TS

readXferImplicit - read with implicit VR little endian TS

processingDetails - show currently processed content item

unknownRelationship - accept unknown/missing relationship type

invalidItemValue - accept invalid content item value (e.g. violation of VR or VM definition)

ignoreConstraints - ignore relationship content constraints

ignoreItemErrors - do not abort on content item errors, just warn (e.g. missing value type specific attributes)

skipInvalidItems - skip invalid content items (incl. sub-tree)

disableVrChecker - disable check for VR-conformant string values

charsetRequire - require declaration of ext. charset (default)

charsetCheckAll - check all data elements with string values (default: only PN, LO, LT, SH, ST, UC and UT)

convertToUtf8 - convert all element values that are affected by Specific Character Set (0008,0005) to UTF-8

html32 - use only HTML version 3.2 compatible features

html40 - allow all HTML version 4.01 features (default)

xhtml11 - comply with XHTML version 1.1 specification

addDocumentType - add reference to SGML document type definition





expandInline - expand short content items inline (default)

neverExpandInline - never expand content items inline

alwaysExpandInline - always expand content items inline

renderFullData - render full data of content items

sectionTitleInline - render section titles inline, not separately

documentTypeTitle - use document type as document title (default)

patientInfoTitle - use patient information as document title

noDocumentHeader - do not render general document information

renderInlineCodes - render codes in continuous text blocks

conceptNameCodes - render code of concept names

numericUnitCodes - render code of numeric measurement units

codeValueUnit - use code value as measurement unit (default)

codeMeaningUnit - use code meaning as measurement unit

renderAllCodes - render all codes (implies +Ci, +Cn and +Cu)

codeDetailsTooltip - render code details as a tooltip (implies +Cc)


Load sample inputs Run

Download

Read a DICOM structured report file and generate a plain text representation



unknownRelationship - Accept unknown relationship type

invalidItemValue - Accept invalid content item value

ignoreConstraints - Ignore relationship constraints

ignoreItemErrors - Ignore content item errors

skipInvalidItems - Skip invalid content items

noDocumentHeader - Print no document header

numberNestedItems - Number nested items

shortenLongValues - Shorten long item values

printInstanceUid - Print SOP Instance UID

printSopclassShort - Print short SOP class name

printSopclassLong - Print SOP class name

printSopclassUid - Print long SOP class name

printAllCodes - Print all codes

printInvalidCodes - Print invalid codes

printTemplateId - Print template identification

indicateEnhanced - Indicate enhanced encoding mode

printColor - Use ANSI escape codes


Load sample inputs Run

Download

Write DICOM segmentation object using multiple input images.







skipEmptySlices - Skip empty slices while encoding segmentation image.By default, empty slices will not be encoded, resulting in a smaller output file size.

useLabelidAsSegmentnumber - Use label IDs from ITK images asSegment Numbers in DICOM. Only works if label IDs are consecutively numbered starting from 1, otherwise conversion will fail.


Load sample inputs Run

Download

Write DICOM segmentation object for overlapping segments.







skipEmptySlices - Skip empty slices while encoding segmentation image.By default, empty slices will not be encoded, resulting in a smaller output file size.

useLabelidAsSegmentnumber - Use label IDs from ITK images asSegment Numbers in DICOM. Only works if label IDs are consecutively numbered starting from 1, otherwise conversion will fail.


Load sample inputs Run

Download

Write DICOM segmentation object.







skipEmptySlices - Skip empty slices while encoding segmentation image.By default, empty slices will not be encoded, resulting in a smaller output file size.

useLabelidAsSegmentnumber - Use label IDs from ITK images asSegment Numbers in DICOM. Only works if label IDs are consecutively numbered starting from 1, otherwise conversion will fail.


Load sample inputs Run

Download