Created
October 20, 2014 15:51
-
-
Save rherrick/a75ad4f91897d0379c07 to your computer and use it in GitHub Desktop.
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
import org.dcm4che2.data.Tag | |
logger.info("Now running the splitPetMrSession script for project ${projectId}, I was passed ${defaultValue}") | |
def sopClassUID = dicom.getString(Tag.SOPClassUID) | |
def modality = dicom.getString(Tag.Modality) | |
def seriesDescription = dicom.getString(Tag.SeriesDescription) | |
def isPet = "PT".equals(modality) || ("1.3.12.2.1107.5.9.1".equals(sopClassUID) && "PET Start".equals(seriesDescription)) | |
logger.info("Found sopClassUID: ${sopClassUID}") | |
logger.info("Found modality: ${modality}") | |
logger.info("Found seriesDescription: ${seriesDescription}") | |
logger.info("Found isPet: ${isPet}") | |
def returnValue = isPet ? defaultValue.reverse().replaceFirst("RM", "TEP").reverse() : defaultValue | |
logger.info("Result: ${returnValue}") | |
"${returnValue}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment