public void Test330DegreeXAxialRotationGantryTiltedSource()
        {
            DataSetOrientation orientation = DataSetOrientation.CreateGantryTiltedAboutX(-30);

            // it doesn't really matter what function we use
            TestVolume(VolumeFunction.Void, orientation.Initialize, null);
        }
        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);
                }
            });
        }
        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);
                }
            });
        }
 public XAxialRotationGantryTiledTestVolume(VolumeFunction function, float tiltDegrees) : base(function)
 {
     _tiltDegrees        = tiltDegrees;
     _dataSetOrientation = DataSetOrientation.CreateGantryTiltedAboutX(tiltDegrees);
 }
        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);
        }