Beispiel #1
0
        public void Test330DegreeXAxialRotationGantryTiltedSource()
        {
            DataSetOrientation orientation = DataSetOrientation.CreateGantryTiltedAboutX(-30);

            // it doesn't really matter what function we use
            TestVolume(VolumeFunction.Void, orientation.Initialize, null);
        }
Beispiel #2
0
        public void TestNegativeXAxialGantryTiltedSlicings()
        {
            DataSetOrientation orientation = DataSetOrientation.CreateGantryTiltedAboutX(-15);

            TestVolume(VolumeFunction.StarsTilted345X,
                       orientation.Initialize,
                       volume =>
            {
                foreach (IVolumeSlicerParams slicing in _slicings)
                {
                    ValidateVolumeSlicePoints(volume, slicing, StarsKnownSamples, -15, 0, true);
                }
            });
        }
Beispiel #3
0
        public void TestNegativeXAxialGantryTiltedSlicings()
        {
            Assert.Ignore("Test assumes certain MPR parameters (slice spacing, pixel spacing) which have changed. Test needs to be rewritten.");

            DataSetOrientation orientation = DataSetOrientation.CreateGantryTiltedAboutX(-15);

            TestVolume(VolumeFunction.StarsTilted345X,
                       orientation.Initialize,
                       volume =>
            {
                foreach (IVolumeSlicerParams slicing in _slicings)
                {
                    ValidateVolumeSlicePoints(volume, slicing, StarsKnownSamples, -15, 0, true);
                }
            });
        }
Beispiel #4
0
        public void TestXAxialRotationGantryTiltedVoxelData()
        {
            const double       angle       = 30;
            DataSetOrientation orientation = DataSetOrientation.CreateGantryTiltedAboutX(angle);

            TestVolume(VolumeFunction.Stars,
                       orientation.Initialize,
                       volume =>
            {
                foreach (KnownSample sample in StarsKnownSamples)
                {
                    Vector3D realPoint   = sample.Point;
                    Vector3D paddedPoint = realPoint + new Vector3D(0, (float)(Math.Tan(angle * Math.PI / 180) * (100 - realPoint.Z)), 0);

                    int actual = volume[(int)paddedPoint.X, (int)paddedPoint.Y, (int)paddedPoint.Z];
                    Trace.WriteLine(string.Format("Sample {0} @{1} ({2} before padding)", actual, paddedPoint, realPoint));
                    Assert.AreEqual(sample.Value, actual, "Wrong colour sample @{0} ({1} before padding)", paddedPoint, realPoint);
                }
            });
        }
Beispiel #5
0
 public XAxialRotationGantryTiledTestVolume(VolumeFunction function, float tiltDegrees) : base(function)
 {
     _tiltDegrees        = tiltDegrees;
     _dataSetOrientation = DataSetOrientation.CreateGantryTiltedAboutX(tiltDegrees);
 }
Beispiel #6
0
        public void TestDifferentImageOrientationSource()
        {
            int n = 0;

            // it doesn't really matter what function we use
            TestVolume(VolumeFunction.Void, sopDataSource => sopDataSource[DicomTags.ImageOrientationPatient].SetStringValue(DataSetOrientation.CreateGantryTiltedAboutX(n++).ImageOrientationPatient), null);
        }