Skip to content

Commit ba2686c

Browse files
author
hurtbadly
committed
added docs for structs
1 parent 7ad2db4 commit ba2686c

File tree

1 file changed

+188
-7
lines changed

1 file changed

+188
-7
lines changed

src/MedImage_data_struct.jl

Lines changed: 188 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,74 @@ using UUIDs
77
export MedImage, Image_type, Image_subtype, current_device_enum, Interpolator_enum, Mode_mi, CoordinateTerms, CoordinateMajornessTerms, Orientation_code
88

99
"""
10-
Defining image type enum
10+
11+
@enum Image_type
12+
13+
14+
Defines the type of medical image. Possible values are:
15+
16+
- `MRI_type`: Magnetic Resonance Imaging
17+
18+
- `PET_type`: Positron Emission Tomography
19+
20+
- `CT_type`: Computed Tomography
21+
1122
"""
1223
@enum Image_type begin
1324
MRI_type
1425
PET_type
1526
CT_type
1627
end
1728

29+
30+
31+
"""
32+
33+
@enum current_device_enum
34+
35+
36+
Specifies the current device used for processing. Possible values are:
37+
38+
- `CPU_current_device`: Central Processing Unit
39+
40+
- `CUDA_current_device`: NVIDIA CUDA-enabled GPU
41+
42+
- `AMD_current_device`: AMD GPU
43+
44+
- `ONEAPI_current_device`: Intel oneAPI-enabled device
45+
46+
"""
1847
@enum current_device_enum begin
1948
CPU_current_device
2049
CUDA_current_device
2150
AMD_current_device
2251
ONEAPI_current_device
2352

2453
end
54+
55+
2556
"""
26-
Defining subimage type enum
57+
@enum Image_subtype
58+
59+
60+
Defines the subtype of medical image. Possible values include:
61+
62+
- `CT_subtype`: CT scan subtype
63+
64+
- `ADC_subtype`: Apparent Diffusion Coefficient
65+
66+
- `DWI_subtype`: Diffusion Weighted Imaging
67+
68+
- `T1_subtype`: T1-weighted MRI
69+
70+
- `T2_subtype`: T2-weighted MRI
71+
72+
- `FLAIR_subtype`: Fluid-attenuated inversion recovery
73+
74+
- `FDG_subtype`: Fluorodeoxyglucose PET
75+
76+
- `PSMA_subtype`: Prostate-Specific Membrane Antigen PET
77+
2778
"""
2879
@enum Image_subtype begin
2980
CT_subtype
@@ -41,7 +92,53 @@ end
4192
#struct for now, will switch to MetaArrays when it has GPU support
4293

4394
"""
44-
Definition for standardised MedImage Struct
95+
96+
mutable struct MedImage
97+
98+
99+
A standardized structure for storing medical image data and metadata.
100+
101+
102+
# Fields
103+
104+
- `voxel_data`: Multidimensional array representing the image data.
105+
106+
- `origin`: Tuple of 3 Float64 values indicating the origin of the image.
107+
108+
- `spacing`: Tuple of 3 Float64 values indicating the spacing between voxels.
109+
110+
- `direction`: 9-element tuple of Float64 values for orientation cosines.
111+
112+
- `image_type`: Enum `Image_type` indicating the type of image.
113+
114+
- `image_subtype`: Enum `Image_subtype` indicating the subtype of image.
115+
116+
- `date_of_saving`: DateTime when the image was saved.
117+
118+
- `acquistion_time`: DateTime when the image was acquired.
119+
120+
- `patient_id`: String identifier for the patient.
121+
122+
- `current_device`: Enum `current_device_enum` indicating the processing device.
123+
124+
- `study_uid`: Unique identifier for the study.
125+
126+
- `patient_uid`: Unique identifier for the patient.
127+
128+
- `series_uid`: Unique identifier for the series.
129+
130+
- `study_description`: Description of the study.
131+
132+
- `legacy_file_name`: Original file name.
133+
134+
- `display_data`: Dictionary for color values (e.g., RGB or grayscale).
135+
136+
- `clinical_data`: Dictionary with clinical data (e.g., age, gender).
137+
138+
- `is_contrast_administered`: Boolean indicating if contrast was used.
139+
140+
- `metadata`: Dictionary for additional metadata.
141+
45142
"""
46143
@with_kw mutable struct MedImage
47144
voxel_data #mutlidimensional array (512,512,3)
@@ -71,22 +168,61 @@ end
71168
# return MedImage(MedImage_struct_attribute_values...)
72169
# end
73170

171+
"""
172+
173+
@enum Interpolator_enum
74174
75175
76-
"""
77-
Definitions of basic interpolators
176+
Defines basic interpolators for image processing. Possible values are:
177+
178+
- `Nearest_neighbour_en`: Nearest neighbor interpolation
179+
180+
- `Linear_en`: Linear interpolation
181+
182+
- `B_spline_en`: B-spline interpolation
183+
78184
"""
79185
@enum Interpolator_enum Nearest_neighbour_en Linear_en B_spline_en
80186

81187
"""
82-
Indicating do we want to change underlying pixel array spatial metadata or both
188+
189+
@enum Mode_mi
190+
191+
192+
Indicates the mode of operation for modifying image data. Possible values are:
193+
194+
- `pixel_array_mode`: Modify pixel array only
195+
196+
- `spat_metadata_mode`: Modify spatial metadata only
197+
198+
- `all_mode`: Modify both pixel array and spatial metadata
199+
83200
"""
84201
@enum Mode_mi pixel_array_mode = 0 spat_metadata_mode = 2 all_mode = 3
85202

86203

87204
################## orientation
88205
"""
89-
enums based on https://github.com/InsightSoftwareConsortium/ITK/blob/311b7060ef39e371f3cd209ec135284ff5fde735/Modules/Core/Common/include/itkSpatialOrientation.h#L88
206+
207+
@enum CoordinateTerms
208+
209+
210+
Defines coordinate terms based on ITK spatial orientation. Possible values are:
211+
212+
- `ITK_COORDINATE_UNKNOWN`: Unknown coordinate
213+
214+
- `ITK_COORDINATE_Right`: Right
215+
216+
- `ITK_COORDINATE_Left`: Left
217+
218+
- `ITK_COORDINATE_Posterior`: Posterior
219+
220+
- `ITK_COORDINATE_Anterior`: Anterior
221+
222+
- `ITK_COORDINATE_Inferior`: Inferior
223+
224+
- `ITK_COORDINATE_Superior`: Superior
225+
90226
"""
91227
@enum CoordinateTerms begin
92228
ITK_COORDINATE_UNKNOWN = 0
@@ -98,12 +234,57 @@ enums based on https://github.com/InsightSoftwareConsortium/ITK/blob/311b7060ef3
98234
ITK_COORDINATE_Superior = 9
99235
end
100236

237+
238+
239+
240+
241+
"""
242+
243+
@enum CoordinateMajornessTerms
244+
245+
246+
Defines the majorness of coordinates. Possible values are:
247+
248+
- `PrimaryMinor`: Primary minor coordinate
249+
250+
- `SecondaryMinor`: Secondary minor coordinate
251+
252+
- `TertiaryMinor`: Tertiary minor coordinate
253+
254+
"""
101255
@enum CoordinateMajornessTerms begin
102256
PrimaryMinor = 0
103257
SecondaryMinor = 8
104258
TertiaryMinor = 16
105259
end
106260

261+
262+
263+
264+
"""
265+
266+
@enum Orientation_code
267+
268+
269+
Defines orientation codes for medical images. Possible values include:
270+
271+
- `ORIENTATION_RPI`: Right-Posterior-Inferior
272+
273+
- `ORIENTATION_LPI`: Left-Posterior-Inferior
274+
275+
- `ORIENTATION_RAI`: Right-Anterior-Inferior
276+
277+
- `ORIENTATION_LAI`: Left-Anterior-Inferior
278+
279+
- `ORIENTATION_RPS`: Right-Posterior-Superior
280+
281+
- `ORIENTATION_LPS`: Left-Posterior-Superior
282+
283+
- `ORIENTATION_RAS`: Right-Anterior-Superior
284+
285+
- `ORIENTATION_LAS`: Left-Anterior-Superior
286+
287+
"""
107288
@enum Orientation_code begin
108289
# ORIENTATION_RIP
109290
# ORIENTATION_LIP

0 commit comments

Comments
 (0)