Skip to content

Instantly share code, notes, and snippets.

@rherrick
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rherrick/0721d611a4e82326e420 to your computer and use it in GitHub Desktop.
Save rherrick/0721d611a4e82326e420 to your computer and use it in GitHub Desktop.
This actually splits the session into PET and MR sessions.
{
"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"
}
@rherrick
Copy link
Author

rherrick commented Oct 7, 2014

This can be PUT to the server with a URL like this:

http://server/data/projects/prj001/automation/scripts/splitPetMrSessionProject1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment