Skip to content

Commit 5609c11

Browse files
committed
added ArtifactTypeEnum
Signed-off-by: Lillie Dae <[email protected]>
1 parent e54294c commit 5609c11

File tree

5 files changed

+187
-1
lines changed

5 files changed

+187
-1
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,3 +350,5 @@ MigrationBackup/
350350

351351
# Ionide (cross platform F# VS Code tools) working folder
352352
.ionide/
353+
354+
*/.idea/*

src/Messaging/Common/Artifact.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ namespace Monai.Deploy.Messaging.Common
1818
{
1919
public class Artifact
2020
{
21-
public string Type { get; set; } = string.Empty;
21+
public ArtifactTypeEnum Type { get; set; } = ArtifactTypeEnum.Unset;
2222
public string Path { get; set; } = string.Empty;
2323
}
2424
}
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
/*
2+
* Copyright 2022-2023 MONAI Consortium
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
namespace Monai.Deploy.Messaging.Common
18+
{
19+
public enum ArtifactTypeEnum
20+
{
21+
Unset, //Unset
22+
AR, //Autorefraction
23+
ASMT, //Content Assessment Results
24+
AU, //Audio
25+
BDUS, //Bone Densitometry (ultrasound)
26+
BI, //Biomagnetic imaging
27+
BMD, //Bone Densitometry (X-Ray)
28+
CR, //Computed Radiography
29+
CT, //Computed Tomography
30+
DG, //Diaphanography
31+
DOC, //Document
32+
DX, //Digital Radiography
33+
ECG, //Electrocardiography
34+
EPS, //Cardiac Electrophysiology
35+
ES, //Endoscopy
36+
FID, //Fiducials
37+
GM, //General Microscopy
38+
HC, //Hard Copy
39+
HD, //Hemodynamic Waveform
40+
IO, //Intra-Oral Radiography
41+
IOL, //Intraocular Lens Data
42+
IVOCT, //Intravascular Optical Coherence Tomography
43+
IVUS, //Intravascular Ultrasound
44+
KER, //Keratometry
45+
KO, //Key Object Selection
46+
LEN, //Lensometry
47+
LS, //Laser surface scan
48+
MG, //Mammography
49+
MR, //Magnetic Resonance
50+
NM, //Nuclear Medicine
51+
OAM, //Ophthalmic Axial Measurements
52+
OCT, //Optical Coherence Tomography (non-Ophthalmic)
53+
OP, //Ophthalmic Photography
54+
OPM, //Ophthalmic Mapping
55+
OPT, //Ophthalmic Tomography
56+
OPV, //Ophthalmic Visual Field
57+
OSS, //Optical Surface Scan
58+
OT, //Other
59+
PLAN, //Plan
60+
PR, //Presentation State
61+
PT, //Positron emission tomography (PET)
62+
PX, //Panoramic X-Ray
63+
REG, //Registration
64+
RESP, //Respiratory Waveform
65+
RF, //Radio Fluoroscopy
66+
RG, //Radiographic imaging (conventional film/screen)
67+
RTDOSE, //Radiotherapy Dose
68+
RTIMAGE, //Radiotherapy Image
69+
RTPLAN, //Radiotherapy Plan
70+
RTRECORD, //RT Treatment Record
71+
RTSTRUCT, //Radiotherapy Structure Set
72+
RWV, //Real World Value Map
73+
SEG, //Segmentation
74+
SM, //Slide Microscopy
75+
SMR, //Stereometric Relationship
76+
SR, //SR Document
77+
SRF, //Subjective Refraction
78+
STAIN, //Automated Slide Stainer
79+
TG, //Thermography
80+
US, //Ultrasound
81+
VA, //Visual Acuity
82+
XA, //X-Ray Angiography
83+
XC, //External-camera Photography
84+
};
85+
}

src/Messaging/Common/ArtifactTypes.cs

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
namespace Monai.Deploy.Messaging.Common
2+
{
3+
public static class ArtifactTypes
4+
{
5+
private static readonly Dictionary<ArtifactTypeEnum, string> ListOfModularity = new()
6+
{
7+
{ ArtifactTypeEnum.Unset, "Unset" },
8+
{ ArtifactTypeEnum.AR, "Autorefract (ArtifactType.ion" },
9+
{ ArtifactTypeEnum.ASMT, "Content Assessment Results" },
10+
{ ArtifactTypeEnum.AU, "Audio" },
11+
{ ArtifactTypeEnum.BDUS, "Bone Densitometry (ultrasound)" },
12+
{ ArtifactTypeEnum.BI, "Biomagnetic imaging" },
13+
{ ArtifactTypeEnum.BMD, "Bone Densitometry (X-Ray)" },
14+
{ ArtifactTypeEnum.CR, "Computed Radiography" },
15+
{ ArtifactTypeEnum.CT, "Computed Tomography" },
16+
{ ArtifactTypeEnum.DG, "Diaphanography" },
17+
{ ArtifactTypeEnum.DOC, "Document" },
18+
{ ArtifactTypeEnum.DX, "Digital Radiography" },
19+
{ ArtifactTypeEnum.ECG, "Electrocardiography" },
20+
{ ArtifactTypeEnum.EPS, "Cardiac Electrophysiology" },
21+
{ ArtifactTypeEnum.ES, "Endoscopy" },
22+
{ ArtifactTypeEnum.FID, "Fiducials" },
23+
{ ArtifactTypeEnum.GM, "General Microscopy" },
24+
{ ArtifactTypeEnum.HC, "Hard Copy" },
25+
{ ArtifactTypeEnum.HD, "Hemodynamic Waveform" },
26+
{ ArtifactTypeEnum.IO, "Intra-Oral Radiography" },
27+
{ ArtifactTypeEnum.IOL, "Intraocular Lens Data" },
28+
{ ArtifactTypeEnum.IVOCT, "Intravascular Optical Coherence Tomography" },
29+
{ ArtifactTypeEnum.IVUS, "Intravascular Ultrasound" },
30+
{ ArtifactTypeEnum.KER, "Keratometry" },
31+
{ ArtifactTypeEnum.KO, "Key Object Selection" },
32+
{ ArtifactTypeEnum.LEN, "Lensometry" },
33+
{ ArtifactTypeEnum.LS, "Laser surface scan" },
34+
{ ArtifactTypeEnum.MG, "Mammography" },
35+
{ ArtifactTypeEnum.MR, "Magnetic Resonance" },
36+
{ ArtifactTypeEnum.NM, "Nuclear Medicine" },
37+
{ ArtifactTypeEnum.OAM, "Ophthalmic Axial Measurements" },
38+
{ ArtifactTypeEnum.OCT, "Optical Coherence Tomography (non-Ophthalmic)" },
39+
{ ArtifactTypeEnum.OP, "Ophthalmic Photography" },
40+
{ ArtifactTypeEnum.OPM, "Ophthalmic Mapping" },
41+
{ ArtifactTypeEnum.OPT, "Ophthalmic Tomography" },
42+
{ ArtifactTypeEnum.OPV, "Ophthalmic Visual Field" },
43+
{ ArtifactTypeEnum.OSS, "Optical Surface Scan" },
44+
{ ArtifactTypeEnum.OT, "Other" },
45+
{ ArtifactTypeEnum.PLAN, "Plan" },
46+
{ ArtifactTypeEnum.PR, "Presentation State" },
47+
{ ArtifactTypeEnum.PT, "Positron emission tomography (PET)" },
48+
{ ArtifactTypeEnum.PX, "Panoramic X-Ray" },
49+
{ ArtifactTypeEnum.REG, "Registration" },
50+
{ ArtifactTypeEnum.RESP, "Respiratory Waveform" },
51+
{ ArtifactTypeEnum.RF, "Radio Fluoroscopy" },
52+
{ ArtifactTypeEnum.RG, "Radiographic imaging (conventional film/screen)" },
53+
{ ArtifactTypeEnum.RTDOSE, "Radiotherapy Dose" },
54+
{ ArtifactTypeEnum.RTIMAGE, "Radiotherapy Image" },
55+
{ ArtifactTypeEnum.RTPLAN, "Radiotherapy Plan" },
56+
{ ArtifactTypeEnum.RTRECORD, "RT Treatment Record" },
57+
{ ArtifactTypeEnum.RTSTRUCT, "Radiotherapy Structure Set" },
58+
{ ArtifactTypeEnum.RWV, "Real World Value Map" },
59+
{ ArtifactTypeEnum.SEG, "Segmentation" },
60+
{ ArtifactTypeEnum.SM, "Slide Microscopy" },
61+
{ ArtifactTypeEnum.SMR, "Stereometric Relationship" },
62+
{ ArtifactTypeEnum.SR, "SR Document" },
63+
{ ArtifactTypeEnum.SRF, "Subjective Refraction" },
64+
{ ArtifactTypeEnum.STAIN, "Automated Slide Stainer" },
65+
{ ArtifactTypeEnum.TG, "Thermography" },
66+
{ ArtifactTypeEnum.US, "Ultrasound" },
67+
{ ArtifactTypeEnum.VA, "Visual Acuity" },
68+
{ ArtifactTypeEnum.XA, "X-Ray Angiography" },
69+
{ ArtifactTypeEnum.XC, "External-camera Photography" },
70+
};
71+
72+
public static bool Validate(string artifactType)
73+
{
74+
return ListOfModularity.Any(x =>
75+
Enum.TryParse<ArtifactTypeEnum>(artifactType, out var artifact)
76+
&& x.Key == artifact);
77+
}
78+
}
79+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
using Monai.Deploy.Messaging.Common;
2+
using Xunit;
3+
4+
namespace Monai.Deploy.Messaging.Tests.Common
5+
{
6+
public class ArtifactTypesTests
7+
{
8+
[Fact]
9+
public void ArtifactTypeValid_ShouldReturnTrue()
10+
{
11+
Assert.True(ArtifactTypes.Validate("CR"));
12+
}
13+
14+
[Fact]
15+
public void ArtifactTypeInvalid_ShouldReturnFalse()
16+
{
17+
Assert.False(ArtifactTypes.Validate("false"));
18+
}
19+
}
20+
}

0 commit comments

Comments
 (0)