コード例 #1
0
 public void TestSafePrivateGEPACSRelated_CreatorFromList() throws Exception {
   AttributeList list = new AttributeList();
   {
     Attribute a = new LongStringAttribute(new AttributeTag(0x0903, 0x0010));
     a.addValue("GEIIS PACS");
     list.put(a);
   }
   assertTrue(
       "Checking Reject Image Flag is safe",
       ClinicalTrialsAttributes.isSafePrivateAttribute(new AttributeTag(0x0903, 0x1010), list));
 }
コード例 #2
0
 public void TestSafePrivatePhilipsPETRelated_ScaleFactors_FromList() throws Exception {
   AttributeList list = new AttributeList();
   {
     Attribute a = new LongStringAttribute(new AttributeTag(0x7053, 0x0010));
     a.addValue("Philips PET Private Group");
     list.put(a);
   }
   assertTrue(
       "Checking SUV Factor is safe",
       ClinicalTrialsAttributes.isSafePrivateAttribute(new AttributeTag(0x7053, 0x1000), list));
   assertTrue(
       "Checking Activity Concentration Factor is safe",
       ClinicalTrialsAttributes.isSafePrivateAttribute(new AttributeTag(0x7053, 0x1009), list));
 }
コード例 #3
0
 public void TestSafePrivateGEPACSRelated_FromFile() throws Exception {
   AttributeList list = new AttributeList();
   String testFilePath = System.getProperty("com.pixelmed.test.filepath");
   // System.err.println("TestSafePrivateGEPACSRelated.TestSafePrivateGEPACSRelated_FromFile():
   // testFilePath = "+testFilePath);
   list.read(new java.io.File(testFilePath, "philipsctwithgepacsprivateattributes.dcm"));
   // System.err.print("TestSafePrivateGEPACSRelated.TestSafePrivateGEPACSRelated():\n"+list);
   list.removeUnsafePrivateAttributes();
   assertTrue(
       "Checking Creator is not removed", list.get(new AttributeTag(0x0903, 0x0010)) != null);
   assertTrue(
       "Checking Reject Image Flag is not removed",
       list.get(new AttributeTag(0x0903, 0x1010)) != null);
 }
コード例 #4
0
 public void TestSafePrivateGEPACSRelated_AddedToList() throws Exception {
   AttributeList list = new AttributeList();
   {
     Attribute a = new LongStringAttribute(new AttributeTag(0x0903, 0x0010));
     a.addValue("GEIIS PACS");
     list.put(a);
   }
   {
     Attribute a = new UnsignedShortAttribute(new AttributeTag(0x0903, 0x1010));
     a.addValue(0);
     list.put(a);
   }
   list.removeUnsafePrivateAttributes();
   assertTrue(
       "Checking Creator is not removed", list.get(new AttributeTag(0x0903, 0x0010)) != null);
   assertTrue(
       "Checking Reject Image Flag is not removed",
       ClinicalTrialsAttributes.isSafePrivateAttribute(new AttributeTag(0x0903, 0x1010), list));
 }
コード例 #5
0
 private void testIsNotRemovedAndRetainsValue(
     String description,
     AttributeTag creatorTag,
     String creator,
     Attribute privateAttribute,
     String expectValue)
     throws DicomException {
   AttributeList list = new AttributeList();
   {
     Attribute a = new LongStringAttribute(creatorTag);
     a.addValue(creator);
     list.put(a);
   }
   list.put(privateAttribute);
   AttributeTag privateTag = privateAttribute.getTag();
   list.removeUnsafePrivateAttributes();
   assertTrue("Checking Creator is not removed", list.get(creatorTag) != null);
   assertEquals(
       "Checking Creator retains value",
       creator,
       Attribute.getDelimitedStringValuesOrEmptyString(list, creatorTag));
   assertTrue("Checking " + description + " is not removed", list.get(privateTag) != null);
   assertEquals(
       "Checking " + description + " retains value",
       expectValue,
       Attribute.getDelimitedStringValuesOrEmptyString(list, privateTag));
 }
コード例 #6
0
 public void TestSafePrivateGEMRRelated_CreatorFromList() throws Exception {
   {
     AttributeList list = new AttributeList();
     {
       Attribute a = new LongStringAttribute(new AttributeTag(0x0019, 0x0010));
       a.addValue("GEMS_ACQU_01");
       list.put(a);
     }
     assertTrue(
         "Internal Pulse Sequence Name is safe",
         ClinicalTrialsAttributes.isSafePrivateAttribute(new AttributeTag(0x0019, 0x109E), list));
   }
   {
     AttributeList list = new AttributeList();
     {
       Attribute a = new LongStringAttribute(new AttributeTag(0x0025, 0x0010));
       a.addValue("GEMS_SERS_01");
       list.put(a);
     }
     assertTrue(
         "Images In Series is safe",
         ClinicalTrialsAttributes.isSafePrivateAttribute(new AttributeTag(0x0025, 0x1007), list));
   }
   {
     AttributeList list = new AttributeList();
     {
       Attribute a = new LongStringAttribute(new AttributeTag(0x0043, 0x0010));
       a.addValue("GEMS_PARM_01");
       list.put(a);
     }
     assertTrue(
         "Scanner Table Entry + Gradient Coil Selected",
         ClinicalTrialsAttributes.isSafePrivateAttribute(new AttributeTag(0x0043, 0x106F), list));
   }
 }
コード例 #7
0
 public void TestSafePrivatePhilipsPETRelated_ScaleFactors_FromFile() throws Exception {
   AttributeList list = new AttributeList();
   String testFilePath = System.getProperty("com.pixelmed.test.filepath");
   // System.err.println("TestSafePrivatePhilipsPETRelated.TestSafePrivatePhilipsPETRelated_ScaleFactors_FromFile(): testFilePath = "+testFilePath);
   list.read(new java.io.File(testFilePath, "philipssuvandactivityscalefactors.dcm"));
   // System.err.print("TestSafePrivatePhilipsPETRelated.TestSafePrivatePhilipsPETRelated_ScaleFactors():\n"+list);
   list.removeUnsafePrivateAttributes();
   assertTrue(
       "Checking Creator is not removed", list.get(new AttributeTag(0x7053, 0x0010)) != null);
   assertTrue(
       "Checking SUV Factor is not removed", list.get(new AttributeTag(0x7053, 0x1000)) != null);
   assertTrue(
       "Checking Activity Concentration Factor is not removed",
       list.get(new AttributeTag(0x7053, 0x1009)) != null);
 }