Commits

Anonymous committed bdbaaf0

Removed PET Tracer from applet.

Comments (0)

Files changed (3)

src/main/java/org/nrg/upload/data/Project.java

 	private final Future<Map<String,String>> sessions;
 	private final Future<org.nrg.dcm.edit.ScriptApplicator> dicomScriptApplicator;
 	private final Future<org.nrg.ecat.edit.ScriptApplicator> ecatScriptApplicator;
-	private final Future<Set<String>> petTracers;
     private final Future<PrearchiveCode> prearchiveCode;
 
 	public Project(final String name, final RestServer xnat, final Map<?,?> wizardParams) {
 				getDicomFunctions(sessions)));
 		ecatScriptApplicator = executor.submit(new ECATScriptApplicatorRetriever(xnat, name,
 				getEcatFunctions(sessions, wizardParams)));
-		petTracers = executor.submit(new PETTracerRetriever(xnat, name));
         prearchiveCode = executor.submit(new ProjectPreArcCodeRetriever(xnat, name));
 	}
 
 		return ecatScriptApplicator.get();
 	}
 	
-	public Set<String> getPETTracers()
-	throws InterruptedException,ExecutionException {
-	    return petTracers.get();
-	}
-
 	public PrearchiveCode getPrearchiveCode() throws InterruptedException,ExecutionException {
 	    return prearchiveCode.get();
 	}

src/main/java/org/nrg/upload/data/SessionVariableNames.java

 	public static final String VISIT_LABEL = "*visit*";  //asterisks to avoid any problems with the anon script. this prevents visit from becoming a variable.
 	public static final String PROTOCOL_LABEL = "*protocol*";  //asterisks to avoid any problems with the anon script. this prevents protocol from becoming a variable.
 	
-	public static final String TRACER = "tracer";
-	public static final String TRACER_PATH = "xnat:petSessionData/tracer/name";
-	
 	public static final String BLOOD_GLUCOSE = "blood glucose (mg/dL)";
 	public static final String BLOOD_GLUCOSE_PATH = "xnat:petSessionData/blood_glucose";
 	

src/main/java/org/nrg/upload/ui/AssignSessionVariablesPage.java

 import org.nrg.ecat.EcatSessionVariable;
 import org.nrg.framework.constants.AutoArchive;
 import org.nrg.framework.constants.PrearchiveCode;
-import org.nrg.net.xnat.PETTracerRetriever;
 import org.nrg.upload.data.*;
 import org.nrg.upload.data.SessionVariable.InvalidValueException;
 import org.slf4j.Logger;
     private SessionVariable sessionLabel;
     private Date confirmedDate;
     private boolean isAutoArchiving = false;
-    private SessionVariable tracer = null;
 
     private static final GridBagConstraints SPANNING = new GridBagConstraints() {{
         gridx = 0;
                 predefs.put(v.getName(), v);
             } else if (MODALITY_LABEL.equals(name)) {
                 modalityLabel = v;   // Process this later
-            } else if (TRACER.equals(name)) {
-                logger.trace("found session variable {}, will shadow", v);
-                // tracer is special and PET-only
-                final String field = v.getExportField();
-                if (!Strings.isNullOrEmpty(field) && !TRACER_PATH.equals(field)) {
-                    logger.error("script variable {} has unexpected export path {}, replacing with "
-                                         + TRACER, v, field);
-                }
-                i.remove();
-                tracer = v;  // Process this later
-            }
-        }
-
-        // If this is a PET study, allow the user to specify a tracer.
-        logger.trace("checking for PET in modalities {}", modalities);
-        final boolean hasPET = modalities.contains("PET") || modalities.contains("PT");
-        if (hasPET) {
-            final Set<String> tracers = Sets.newLinkedHashSet();
-            try {
-                tracers.addAll(project.getPETTracers());
-            } catch (Throwable t) {
-                logger.error("error retrieving PET tracers", t);
-                tracers.clear();
-                tracers.addAll(PETTracerRetriever.getDefaultTracers());
-            }
-            if (tracer == null) {
-                tracer = new EnumeratedSessionVariable(TRACER, TRACER_PATH, tracers, true, true);
-            } else {
-                ((EnumeratedSessionVariable) tracer).setItems(tracers);
             }
         }
 
             if (modalityLabel instanceof DicomSessionVariable) {
                 final DicomSessionVariable dsv = (DicomSessionVariable)modalityLabel;
                 try {
-                    if (null == tracer) {
-                        logger.trace("setting (hidden) modality label from lead modality {}", leadModality);
-                        dsv.setInitialValue(new org.nrg.dcm.edit.ConstantValue(leadModality));
-                    } else {
-                        logger.trace("setting (hidden) modality label from tracer variable {}", tracer);
-                        dsv.setInitialValue(new org.nrg.dcm.SessionVariableValue(tracer));
-                        tracer.addListener(dsv);
-                    }
+                    
+                    logger.trace("setting (hidden) modality label from lead modality {}", leadModality);
+                    dsv.setInitialValue(new org.nrg.dcm.edit.ConstantValue(leadModality));
                     dsv.setIsHidden(true);
                 } catch (MultipleInitializationException exception) {
                     logger.debug("Got MultipleInitializationException", exception);
             } else if (modalityLabel instanceof EcatSessionVariable) {
                 final EcatSessionVariable esv = (EcatSessionVariable)modalityLabel;
                 try {
-                    if (null == tracer) {
-                        esv.setInitialValue(new org.nrg.ecat.edit.ConstantValue(leadModality));
-                    } else {
-                        esv.setInitialValue(new org.nrg.ecat.SessionVariableValue(tracer));
-                    }
+                    esv.setInitialValue(new org.nrg.ecat.edit.ConstantValue(leadModality));
                     esv.setIsHidden(true);
                 } catch (org.nrg.ecat.edit.MultipleInitializationException exception) {
                     logger.debug("Got MultipleInitializationException", exception);
         // {subject}_{modality}{index}, where index is the smallest positive integer
         // that results in a session label not already defined in this project.
         final IndexedDependentSessionVariable defaultSessionLabel;
-        if (hasPET) {
-            // use the tracer instead of the modality string for PET
-            assert null != tracer;
-            logger.trace("building indexed tracer default session label from {}", tracer);
-            defaultSessionLabel = new IndexedDependentSessionVariable(SESSION_LABEL, tracer,
-                                                                      subject + "_%s%d", excludeExistingSessions);
-        } else {
-            logger.trace("building indexed modality default session label from {}", leadModality);
-            defaultSessionLabel = new IndexedDependentSessionVariable(SESSION_LABEL,
+
+        logger.trace("building indexed modality default session label from {}", leadModality);
+        defaultSessionLabel = new IndexedDependentSessionVariable(SESSION_LABEL,
                                                                       predefs.get(SUBJECT), "%s_" + leadModality + "%d", excludeExistingSessions);
-        }
 
         if (null == vSession) {
             vars.addFirst(vSession = defaultSessionLabel);
             }
         }
         if (vSession.isMutable()) {
-            // This handles JIRA XNAT-985: upon returning to the page, a new tracer control is created, but the session
-            // identifier control still has a reference to the old tracer control, breaking the dependency between the controls.
-            // We also have to check for tracer != null to keep from overwriting other dependency types, especially when
-            // it uses the subject as the dependency.
-            if (tracer != null && vSession instanceof IndexedDependentSessionVariable) {
-                IndexedDependentSessionVariable indexed = (IndexedDependentSessionVariable) vSession;
-                if (indexed.getDependency() == null || !indexed.getDependency().equals(tracer)) {
-                    indexed.setDependency(tracer);
-                }
-            }
+
             vSession.addValidator(LabelValueValidator.getInstance());
             // vSession.addValidator(excludeExistingSessions);
         }
 
-        if (hasPET) {
-            assert null != tracer;
-            if (!vars.contains(tracer)) {
-                vars.addFirst(tracer);
-            }
-        }
-
         // Session name, like project and subject, must be available in the wizard params.
         putWizardData(vSession.getName(), vSession);