예제 #1
0
파일: test_sr.py 프로젝트: pieper/highdicom
 def setUp(self):
     super().setUp()
     self._observer_person_context = ObserverContext(
         observer_type=codes.cid270.Person,
         observer_identifying_attributes=PersonObserverIdentifyingAttributes(
             name='Foo Bar'))
     self._observer_device_context = ObserverContext(
         observer_type=codes.cid270.Device,
         observer_identifying_attributes=DeviceObserverIdentifyingAttributes(
             uid=generate_uid()))
     self._observation_context = ObservationContext(
         observer_person_context=self._observer_person_context,
         observer_device_context=self._observer_device_context)
     self._procedure_reported = codes.cid100.CTPerfusionHeadWithContrastIV
     self._tracking_identifier = TrackingIdentifier(
         uid=generate_uid(), identifier='planar roi measurements')
     self._image = SourceImageForRegion(
         referenced_sop_class_uid='1.2.840.10008.5.1.4.1.1.2.2',
         referenced_sop_instance_uid=generate_uid())
     self._region = ImageRegion(graphic_type=GraphicTypeValues.CIRCLE,
                                graphic_data=np.array([[1.0, 1.0],
                                                       [2.0, 2.0]]),
                                source_image=self._image)
     self._measurements = PlanarROIMeasurementsAndQualitativeEvaluations(
         tracking_identifier=self._tracking_identifier,
         referenced_region=self._region)
     self._measurement_report = MeasurementReport(
         observation_context=self._observation_context,
         procedure_reported=self._procedure_reported,
         imaging_measurements=[self._measurements])
예제 #2
0
파일: test_sr.py 프로젝트: pieper/highdicom
 def setUp(self):
     '''Creates a Measurement for a numeric value in millimiter unit with
     derivation, method and reference to an image region.'''
     super().setUp()
     self._value = 10
     self._unit = codes.cid7181.SquareMillimeter
     self._tracking_identifier = TrackingIdentifier(
         uid=generate_uid(), identifier='prostate zone size measurement')
     self._derivation = codes.cid7464.Total
     self._method = codes.cid7473.AreaOfClosedIrregularPolygon
     self._location = \
         codes.cid6300.RightAnteriorMiddlePeripheralZoneOfProstate
     self._finding_site = FindingSite(anatomic_location=self._location)
     self._image = SourceImageForRegion(
         referenced_sop_class_uid='1.2.840.10008.5.1.4.1.1.2.2',
         referenced_sop_instance_uid=generate_uid())
     self._region = ImageRegion(graphic_type=GraphicTypeValues.POINT,
                                graphic_data=np.array([[1.0, 1.0]]),
                                source_image=self._image)
     self._name = codes.cid7469.Area
     self._measurement = Measurement(
         name=self._name,
         value=self._value,
         unit=self._unit,
         tracking_identifier=self._tracking_identifier,
         method=self._method,
         derivation=self._derivation,
         finding_sites=[
             self._finding_site,
         ])
예제 #3
0
파일: test_sr.py 프로젝트: pieper/highdicom
 def setUp(self):
     super().setUp()
     self._value = 10.0
     self._unit = codes.cid7181.SquareMillimeter
     self._tracking_identifier = TrackingIdentifier(
         uid=generate_uid(), identifier='prostate zone size measurement')
     self._name = codes.cid7469.Area
     self._measurement = Measurement(
         name=self._name,
         value=self._value,
         unit=self._unit,
         tracking_identifier=self._tracking_identifier)
예제 #4
0
파일: test_sr.py 프로젝트: pieper/highdicom
 def setUp(self):
     super().setUp()
     self._tracking_identifier = TrackingIdentifier(
         uid=generate_uid(), identifier='planar roi measurements')
     self._image = SourceImageForRegion(
         referenced_sop_class_uid='1.2.840.10008.5.1.4.1.1.2.2',
         referenced_sop_instance_uid=generate_uid())
     self._region = ImageRegion(graphic_type=GraphicTypeValues.CIRCLE,
                                graphic_data=np.array([[1.0, 1.0],
                                                       [2.0, 2.0]]),
                                source_image=self._image)
     self._measurements = PlanarROIMeasurementsAndQualitativeEvaluations(
         tracking_identifier=self._tracking_identifier,
         referenced_region=self._region)
예제 #5
0
파일: test_sr.py 프로젝트: pieper/highdicom
 def setUp(self):
     super().setUp()
     self._tracking_identifier = TrackingIdentifier(
         uid=generate_uid(), identifier='volumetric roi measurements')
     self._images = [
         SourceImageForRegion(
             referenced_sop_class_uid='1.2.840.10008.5.1.4.1.1.2.2',
             referenced_sop_instance_uid=generate_uid()) for i in range(3)
     ]
     self._regions = [
         ImageRegion(graphic_type=GraphicTypeValues.POLYLINE,
                     graphic_data=np.array([[1.0, 1.0], [2.0, 2.0],
                                            [3.0, 3.0], [1.0, 1.0]]),
                     source_image=self._images[i]) for i in range(3)
     ]
     self._measurements = VolumetricROIMeasurementsAndQualitativeEvaluations(
         tracking_identifier=self._tracking_identifier,
         referenced_regions=self._regions)
예제 #6
0
파일: test_sr.py 프로젝트: pieper/highdicom
 def test_constructed_without_human_readable_tracking_identifier(self):
     tracking_identifier = TrackingIdentifier(uid=generate_uid())
     with pytest.raises(ValueError):
         PlanarROIMeasurementsAndQualitativeEvaluations(
             tracking_identifier=tracking_identifier,
             referenced_region=self._region)
예제 #7
0
파일: test_sr.py 프로젝트: pieper/highdicom
 def setUp(self):
     super().setUp()
     self._uid = generate_uid()
     self._tracking_identifier = TrackingIdentifier(uid=self._uid)
예제 #8
0
파일: test_sr.py 프로젝트: pieper/highdicom
 def setUp(self):
     super().setUp()
     self._uid = generate_uid()
     self._identifier = 'prostate zone size measurements'
     self._tracking_identifier = TrackingIdentifier(
         uid=self._uid, identifier=self._identifier)