Last active
January 7, 2020 15:41
-
-
Save jvsoest/3f1d3868324cd5ee3a88d409853d4fe7 to your computer and use it in GitHub Desktop.
SEDI retrieval of CT and RTStruct information
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PREFIX sedi: <http://semantic-dicom.org/dcm#> | |
PREFIX seq: <http://semantic-dicom.org/seq#> | |
prefix owl: <http://www.w3.org/2002/07/owl#> | |
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> | |
prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | |
select DISTINCT ?patientID ?studyUID ?seriesUID ?modality ?manufacturer ?model ?softwareVersion ?sopInstanceUID ?sliceThickness ?contourName ?refSeriesUID | |
where { | |
# Get patient & ID | |
?patient rdf:type sedi:Patient. | |
?patient sedi:ATT00100020 ?patientID. | |
# Get study (linked to this patient) | |
?patient sedi:hasStudy ?study. | |
?study sedi:ATT0020000D ?studyUID. | |
OPTIONAL { ?study sedi:ATT00081030 ?studyDesc. } | |
# Get series (linked to this study) | |
?study sedi:containsSeries ?series. | |
?series sedi:ATT0020000E ?seriesUID; | |
sedi:ATT00080060 ?modality. | |
OPTIONAL { ?series sedi:ATT0008103E ?seriesDesc. } | |
# Get image objects (image objects or RTStruct objects) | |
?series ?contains ?image. | |
FILTER (?contains IN (sedi:containsImage, sedi:containsStructureSet)). | |
?image sedi:ATT00080018 ?sopInstanceUID. | |
# Additional series info (not always available in every combination) | |
?equipmentObj sedi:isEquipmentOf ?series. | |
OPTIONAL { ?equipmentObj sedi:ATT00080070 ?manufacturer } | |
OPTIONAL { ?equipmentObj sedi:ATT00081090 ?model } | |
OPTIONAL { ?equipmentObj sedi:ATT00181020 ?softwareVersion } | |
# Additional RTStruct information (contour names) | |
OPTIONAL { | |
?series sedi:containsStructureSet ?rtStruct. | |
?rtStruct sedi:ATT30060020 ?structSetSeq. | |
?structSetSeq seq:hasItem ?item. | |
?item sedi:ATT30060026 ?contourName. | |
# Get referenced series | |
?series sedi:containsStructureSet ?rtStruct. | |
?rtStruct sedi:ATT30060010 ?refFrameRef. | |
?refFrameRef seq:hasItem ?itemRefFrameRef. | |
?itemRefFrameRef sedi:ATT30060012 ?refStudySeq. | |
?refStudySeq seq:hasItem ?refStudySeqItem. | |
?refStudySeqItem sedi:ATT30060014 ?refSeriesSeq. | |
?refSeriesSeq seq:hasItem ?refSeriesSeqItem. | |
?refSeriesSeqItem sedi:ATT0020000E ?refSeriesUID. | |
} | |
# Additional image info CT | |
OPTIONAL { ?image sedi:ATT00180050 ?sliceThickness. } | |
OPTIONAL { ?image sedi:ATT00180060 ?tubeVoltage. } | |
OPTIONAL { ?image sedi:ATT00181100 ?reconstructionDiameter. } #NOT IN SEDI | |
OPTIONAL { ?image sedi:ATT00181151 ?tubeCurrent. } #NOT IN SEDI | |
OPTIONAL { ?image sedi:ATT00181152 ?exposure. } #NOT IN SEDI | |
OPTIONAL { ?image sedi:ATT00181210 ?convolutionKernel. } #NOT IN SEDI | |
OPTIONAL { ?image sedi:ATT00280010 ?rows. } | |
OPTIONAL { ?image sedi:ATT00280011 ?columns. } | |
OPTIONAL { ?image sedi:ATT00280011 ?pixelSpacing. } | |
OPTIONAL { ?image sedi:ATT00280101 ?bitsStored. } | |
OPTIONAL { ?image sedi:ATT00280102 ?highBit. } | |
OPTIONAL { ?image sedi:ATT00281052 ?rescaleOffset. } | |
OPTIONAL { ?image sedi:ATT00281053 ?rescaleSlope. } | |
} ORDER BY ?patientID ?studyUID ?seriesUID ?sopInstanceUID |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment