||
we define the standard DICOM patient-based coordinate system: x, y and z axes.
If Anatomical Orientation Type is absent, the x-axis is increasing to the left hand side of the patient. The y-axis is increasing to the posterior side of the patient. The z-axis is increasing toward the head of the patient.
In a way, it's funny to call this the 'patient-based' coordinate system
The (i, j), columns, rows in DICOM
By voxel coordinates, we mean coordinates of form (r,c,s) - the row, column and slice indices
Packages
(1) NiBabel: pip install nibabel
This package provides read +/- write access to some common medical and neuroimaging file formats, including: ANALYZE (plain, SPM99, SPM2 and later), GIFTI, NIfTI1, NIfTI2, MINC1, MINC2, MGH and ECAT as well as Philips PAR/REC. We can read and write FreeSurfer geometry, annotation and morphometry files. There is some very limited support for DICOM. NiBabel is the successor of PyNIfTI
To deal with DICOM files, NiBabel use excellent PyDICOM as its back-end for reading DICOM.
(2) Pydicom: pip install -U pydicom
https://pydicom.github.io/pydicom/stable/base_element.html#dataset
(3) DICOM-Numpy: pip install dicom_numpy
This python module provides a set of utilities for extracting data contained in DICOM files into Numpy ndarrays. It is a higher-level library that builds on the excellent lower-level pydicom library.
The DICOM standard stores MR, CT, and PET scans as a series of images saved in a separate files. A common task is to combine all of the images that make up a single 3D image into a single scan. The function that performs this task is combine_slices. Since this library builds on pydicom, combine_slices takes an list of pydicom datasets.
Example:
https://dicom-numpy.readthedocs.io/en/latest/
4. Display 3D images
(1) mpl_toolkits.mplot3D.Axes3D
安装matplotlib后,即可使用
https://terbium.io/2017/12/matplotlib-3d/
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-10-19 23:13
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社