Last active
August 29, 2015 14:07
-
-
Save rherrick/0721d611a4e82326e420 to your computer and use it in GitHub Desktop.
This actually splits the session into PET and MR sessions.
This file contains 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
{ | |
"event": "dicomImport", | |
"content": "import org.dcm4che2.data.Tag\n\nlogger.info(\"Now running the splitPetMrSession script for project ${projectId}, I was passed ${defaultValue}\")\ndef sopClassUID = dicom.getString(Tag.SOPClassUID)\ndef modality = dicom.getString(Tag.Modality)\ndef seriesDescription = dicom.getString(Tag.SeriesDescription)\ndef isPet = \"PT\".equals(modality) || (\"1.3.12.2.1107.5.9.1\".equals(sopClassUID) && \"PET Start\".equals(seriesDescription))\nlogger.info(\"Found sopClassUID: ${sopClassUID}\")\nlogger.info(\"Found modality: ${modality}\")\nlogger.info(\"Found seriesDescription: ${seriesDescription}\")\nlogger.info(\"Found isPet: ${isPet}\")\ndef returnValue = isPet ? defaultValue.reverse().replaceFirst(\"RM\", \"TEP\").reverse() : defaultValue\nlogger.info(\"Result: ${returnValue}\")\n\"${returnValue}\"\n", | |
"language": "groovy", | |
"languageVersion": "2.3.6" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This can be PUT to the server with a URL like this:
http://server/data/projects/prj001/automation/scripts/splitPetMrSessionProject1