dicomget
Description
retrieves the DICOM file or files specified by filelist
= dicomget(dConn
,level
,uniqueID
)uniqueID
from the PACS
server indicated by the dicomConnection
object dConn
at the specified query level level
,
and returns the paths of the retrieved files filelist
.
specifies additional options for retrieving the DICOM file or files using one or more
optional name-value arguments. filelist
= dicomget(dConn
,level
,uniqueID
,Name=Value
)
Examples
Retrieve DICOM Files from PACS Server
Before running this example, you must get access from the administrator of the PACS server with which you intend to connect. Alternatively, you may consider setting up a local PACS server on your machine, as demonstrated in Working with PACS Server for DICOM Image Retrieval.
Establish a secure TLS connection with the PACS server using the key and certificate of your client system and the trusted certificate of the server. Display the response message of the DICOM connection.
dConn = dicomConnection("localhost",4242,"key.pem","certificate.pem","trusted-certificate.pem"); disp(dConn.ResponseMessage)
I: Requesting Association I: Association Accepted (Max Send PDV: 16372) I: Sending Echo Request (MsgID 1) I: Received Echo Response (Success) I: Releasing Association
Query the PACS server for the stored DICOM files. Retrieve the DICOM files of the MRI volume.
returnedKey = dicomquery(dConn,"Patient",["PatientID","PatientName"])
returnedKey=1×3 struct array with fields:
PatientID
PatientName
Retrieve one of the queried DICOM files.
filelist = dicomget(dConn,"Patient",returnedKey(1).PatientID);
Read the MRI volume from the retrieved DICOM files.
medVol = medicalVolume(filelist{1})
medVol = medicalVolume with properties: Voxels: [512×512×22 int16] VolumeGeometry: [1×1 medicalref3d] SpatialUnits: "mm" Orientation: "transverse" VoxelSpacing: [0.2734 0.2734 3.3000] NormalVector: [0 0.0968 0.9953] NumCoronalSlices: 512 NumSagittalSlices: 512 NumTransverseSlices: 22 PlaneMapping: ["sagittal" "coronal" "transverse"] Modality: "MR" WindowCenters: [22×1 double] WindowWidths: [22×1 double]
Input Arguments
dConn
— PACS server connection object
dicomConnection
object
PACS server connection object, specified as a dicomConnection
object.
level
— Retrieve level
"Patient"
| "Study"
| "Series"
| "Image"
Retrieve level, specified as "Patient"
,
"Study"
, "Series"
, or
"Image"
. For more information regarding retrieve levels, refer to the
DICOM Query/Retrieve Information Model in the DICOM Standard.
Data Types: char
| string
uniqueID
— Unique ID of DICOM file or files
string scalar | character vector
Unique ID of the DICOM file or files to be retrieved, specified as a string scalar or character vector. The unique ID must be the ID of the DICOM file or files at the specified query level.
Retrieve Level | Unique ID Field |
---|---|
"Patient" | PatientID |
"Study" | StudyInstanceUID |
"Series" | SeriesInstanceUID |
"Image" | SOPInstanceUID |
Data Types: char
| string
Name-Value Arguments
Specify optional pairs of arguments as
Name1=Value1,...,NameN=ValueN
, where Name
is
the argument name and Value
is the corresponding value.
Name-value arguments must appear after other arguments, but the order of the
pairs does not matter.
Example: filelist =
dicomget(dConn,level,uniqueID,StorageDirectory="storage")
retrieves the DICOM
file or files to the directory "storage"
within the current
directory.
Root
— Root level of query
"Patient"
(default) | "Study"
Root level of the query, specified as "Patient"
or
"Study"
.
Data Types: char
| string
StorageDirectory
— Storage directory
current directory (default) | string scalar | character vector
Storage directory for the downloaded DICOM files, specified as a string scalar or character vector. If the specified storage directory does not exist, the function creates the directory before the downloading the files.
Data Types: char
| string
Output Arguments
filelist
— Path of retrieved files
cell array
Paths of the retrieved files, returned as a cell array in which each cell contains a cell array of filenames.
Data Types: string
Version History
Introduced in R2024b
See Also
Objects
Functions
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)