-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.m
33 lines (25 loc) · 1.01 KB
/
example.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
clear all
close all
addpath('./dicomseries');
dirName = './testdata';
options = struct('recursive', true, 'verbose', true, 'loadCache', false);
dicomdict('set', 'dicom-dict-philips.txt');
[partitions, meta] = readDicomSeries(dirName, options);
% Read image by partition index
[image, info] = readDicomSeriesImage(dirName, partitions(1));
image = rescaleDicomImage(image, info);
figure
imagesc(image(:,:,1))
% Read image by matching a specific partition
% Note: StackID is not commonly used, you usually want to match on
% description and ImageType.
seriesDescription = 'm Survey';
[image, info] = readDicomSeriesImage(dirName, partitions, struct('SeriesDescription', seriesDescription, 'StackID', '3'));
image = rescaleDicomImage(image, info);
figure
imagesc(image)
% List matching partitions
parts = findMatchingPartitions(partitions, struct('SeriesDescription', seriesDescription));
for I=1:length(parts)
fprintf('ImageType: %s, Stack ID %s\n', parts(I).partitionStruct.ImageType, parts(I).partitionStruct.StackID);
end