Skip to content

Commit

Permalink
PIXI-137: Make Inveon importer labeling options optional when using t…
Browse files Browse the repository at this point in the history
…he hotel splitter
  • Loading branch information
andylassiter committed Jun 7, 2024
1 parent be02810 commit 5e2c5d5
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,12 @@ private void processScanMap(String projectId) throws ServerException, IOExceptio
}
}

// If the user specified a session label, then ignore session label options
if (params.containsKey(URIManager.EXPT_LABEL)) {
constructSessions();
return;
}

// We believe the scan files are consistent. Create sessions from these.
String sessionLabelOption = (String) params.get("sessionLabelOption");
log.debug("sessionLabelOption: {}", sessionLabelOption);
Expand Down Expand Up @@ -626,6 +632,10 @@ private void processPETSession(InveonSessionFiles inveonSessionFiles, String pro
// Extract a value for Subject ID for this instance of InveonImageRepresentation
// TODO: Need a better scheme than assume the PCIF naming convention
private String extractSubjectId(InveonImageRepresentation inveonImageRepresentation) {
if (params.containsKey(URIManager.SUBJECT_ID)) {
return (String) params.get(URIManager.SUBJECT_ID);
}

String subjectLabelingOption = (String) params.getOrDefault(SUBJECT_LABELING_OPTION_PARAM, "subject_identifier");
String subjectLabelRegex = (String) params.getOrDefault(SUBJECT_LABEL_REGEX_PARAM, "(.*)");

Expand Down Expand Up @@ -664,6 +674,10 @@ private String extractSubjectId(InveonImageRepresentation inveonImageRepresentat
}

private String extractSessionLabel(InveonImageRepresentation inveonImageRepresentation) {
if (params.containsKey(URIManager.EXPT_LABEL)) {
return (String) params.get(URIManager.EXPT_LABEL);
}

String sessionLabelingOption = (String) params.getOrDefault(SESSION_LABELING_OPTION_PARAM, "study_identifier");
String sessionLabelRegex = (String) params.getOrDefault(SESSION_LABEL_REGEX_PARAM, "(.*)");

Expand Down

0 comments on commit 5e2c5d5

Please sign in to comment.