public void TestSimpleDataModalityLut() { const int bitsStored = 8; const bool isSigned = false; const double rescaleSlope = 0.5; const double rescaleIntercept = 10; var modalityLutLinear = new ModalityLutLinear( bitsStored, isSigned, rescaleSlope, rescaleIntercept); var simpleDataModalityLut = new SimpleDataModalityLut(modalityLutLinear.MinInputValue, modalityLutLinear.Data, modalityLutLinear.MinOutputValue, modalityLutLinear.MaxOutputValue, modalityLutLinear.GetKey(), modalityLutLinear.GetDescription()); Assert.AreEqual(modalityLutLinear.MinInputValue, simpleDataModalityLut.MinInputValue, "MinInputValue"); Assert.AreEqual(modalityLutLinear.MaxInputValue, simpleDataModalityLut.MaxInputValue, "MaxInputValue"); Assert.AreEqual(modalityLutLinear.MinOutputValue, simpleDataModalityLut.MinOutputValue, "MinOutputValue"); Assert.AreEqual(modalityLutLinear.MaxOutputValue, simpleDataModalityLut.MaxOutputValue, "MaxOutputValue"); Assert.AreEqual(modalityLutLinear.GetKey(), simpleDataModalityLut.GetKey(), "Key"); Assert.AreEqual(modalityLutLinear.GetDescription(), simpleDataModalityLut.GetDescription(), "Description"); Assert.AreEqual(modalityLutLinear.Length, simpleDataModalityLut.Length, "Length"); for (var n = -1; n < 256; ++n) { Assert.AreEqual(modalityLutLinear[n], simpleDataModalityLut[n], "Value @{0}", n); } simpleDataModalityLut.AssertLookupValues(-1, 256); }
public void TestSimpleDataModalityLut() { const int bitsStored = 8; const bool isSigned = false; const double rescaleSlope = 0.5; const double rescaleIntercept = 10; var modalityLutLinear = new ModalityLutLinear( bitsStored, isSigned, rescaleSlope, rescaleIntercept); var simpleDataModalityLut = new SimpleDataModalityLut(modalityLutLinear.MinInputValue, modalityLutLinear.Data, modalityLutLinear.MinOutputValue, modalityLutLinear.MaxOutputValue, modalityLutLinear.GetKey(), modalityLutLinear.GetDescription()); Assert.AreEqual(modalityLutLinear.MinInputValue, simpleDataModalityLut.MinInputValue, "MinInputValue"); Assert.AreEqual(modalityLutLinear.MaxInputValue, simpleDataModalityLut.MaxInputValue, "MaxInputValue"); Assert.AreEqual(modalityLutLinear.MinOutputValue, simpleDataModalityLut.MinOutputValue, "MinOutputValue"); Assert.AreEqual(modalityLutLinear.MaxOutputValue, simpleDataModalityLut.MaxOutputValue, "MaxOutputValue"); Assert.AreEqual(modalityLutLinear.GetKey(), simpleDataModalityLut.GetKey(), "Key"); Assert.AreEqual(modalityLutLinear.GetDescription(), simpleDataModalityLut.GetDescription(), "Description"); Assert.AreEqual(modalityLutLinear.Length, simpleDataModalityLut.Length, "Length"); for (var n = -1; n < 256; ++n) Assert.AreEqual(modalityLutLinear[n], simpleDataModalityLut[n], "Value @{0}", n); simpleDataModalityLut.AssertLookupValues(-1, 256); }
public void TestSimpleLut() { int bitsStored = 8; bool isSigned = false; double rescaleSlope = 0.5; double rescaleIntercept = 10; ModalityLutLinear modalityLUT = new ModalityLutLinear( bitsStored, isSigned, rescaleSlope, rescaleIntercept); SimpleDataModalityLut simpleLut = new SimpleDataModalityLut(modalityLUT.MinInputValue, modalityLUT.Data, modalityLUT.MinOutputValue, modalityLUT.MaxOutputValue, modalityLUT.GetKey(), modalityLUT.GetDescription()); Assert.AreEqual(modalityLUT.MinInputValue, simpleLut.MinInputValue); Assert.AreEqual(modalityLUT.MaxInputValue, simpleLut.MaxInputValue); Assert.AreEqual(modalityLUT.MinOutputValue, simpleLut.MinOutputValue); Assert.AreEqual(modalityLUT.MaxOutputValue, simpleLut.MaxOutputValue); Assert.AreEqual(modalityLUT.GetKey(), simpleLut.GetKey()); Assert.AreEqual(modalityLUT.GetDescription(), simpleLut.GetDescription()); Assert.AreEqual(modalityLUT.Length, simpleLut.Length); }