def test_nan_oetf_DICOMGSDF(self):
        """
        Tests :func:`colour.models.rgb.transfer_functions.dicom_gsdf.\
oetf_DICOMGSDF` definition nan support.
        """

        oetf_DICOMGSDF(np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
    def test_domain_range_scale_oetf_DICOMGSDF(self):
        """
        Tests :func:`colour.models.rgb.transfer_functions.dicom_gsdf.\
oetf_DICOMGSDF` definition domain and range scale support.
        """

        L = 130.0662
        J = oetf_DICOMGSDF(L)

        d_r = (('reference', 1), (1, 1), (100, 100))
        for scale, factor in d_r:
            with domain_range_scale(scale):
                np.testing.assert_almost_equal(
                    oetf_DICOMGSDF(L * factor), J * factor, decimal=7)
    def test_oetf_DICOMGSDF(self):
        """
        Tests :func:`colour.models.rgb.transfer_functions.dicom_gsdf.\
oetf_DICOMGSDF` definition.
        """

        self.assertAlmostEqual(
            oetf_DICOMGSDF(0.05), 0.001007281350787, places=7)

        self.assertAlmostEqual(
            oetf_DICOMGSDF(130.0662), 0.500486263438448, places=7)

        self.assertAlmostEqual(
            oetf_DICOMGSDF(4000), 1.000160314715578, places=7)

        self.assertAlmostEqual(
            oetf_DICOMGSDF(130.0662, out_int=True), 512, places=7)
Beispiel #4
0
    def test_oetf_DICOMGSDF(self):
        """
        Tests :func:`colour.models.rgb.transfer_functions.dicom_gsdf.\
oetf_DICOMGSDF` definition.
        """

        self.assertAlmostEqual(round(oetf_DICOMGSDF(0.049981846913482)),
                               1,
                               places=7)

        self.assertAlmostEqual(round(oetf_DICOMGSDF(130.065284012159790)),
                               512,
                               places=7)

        self.assertAlmostEqual(round(oetf_DICOMGSDF(3993.329585887327100)),
                               1023,
                               places=7)
Beispiel #5
0
    def test_n_dimensional_oetf_DICOMGSDF(self):
        """
        Tests :func:`colour.models.rgb.transfer_functions.dicom_gsdf.\
oetf_DICOMGSDF` definition n-dimensional arrays support.
        """

        L = 130.0662
        J = oetf_DICOMGSDF(L)

        L = np.tile(L, 6)
        J = np.tile(J, 6)
        np.testing.assert_almost_equal(oetf_DICOMGSDF(L), J, decimal=7)

        L = np.reshape(L, (2, 3))
        J = np.reshape(J, (2, 3))
        np.testing.assert_almost_equal(oetf_DICOMGSDF(L), J, decimal=7)

        L = np.reshape(L, (2, 3, 1))
        J = np.reshape(J, (2, 3, 1))
        np.testing.assert_almost_equal(oetf_DICOMGSDF(L), J, decimal=7)
    def test_n_dimensional_oetf_DICOMGSDF(self):
        """
        Tests :func:`colour.models.rgb.transfer_functions.dicom_gsdf.\
oetf_DICOMGSDF` definition n-dimensional arrays support.
        """

        L = 130.0662
        J = oetf_DICOMGSDF(L)

        L = np.tile(L, 6)
        J = np.tile(J, 6)
        np.testing.assert_almost_equal(oetf_DICOMGSDF(L), J, decimal=7)

        L = np.reshape(L, (2, 3))
        J = np.reshape(J, (2, 3))
        np.testing.assert_almost_equal(oetf_DICOMGSDF(L), J, decimal=7)

        L = np.reshape(L, (2, 3, 1))
        J = np.reshape(J, (2, 3, 1))
        np.testing.assert_almost_equal(oetf_DICOMGSDF(L), J, decimal=7)
Beispiel #7
0
    def test_oetf_DICOMGSDF(self):
        """
        Tests :func:`colour.models.rgb.transfer_functions.dicom_gsdf.\
oetf_DICOMGSDF` definition.
        """

        self.assertAlmostEqual(oetf_DICOMGSDF(0.05),
                               0.001007281350787,
                               places=7)

        self.assertAlmostEqual(oetf_DICOMGSDF(130.0662),
                               0.500486263438448,
                               places=7)

        self.assertAlmostEqual(oetf_DICOMGSDF(4000),
                               1.000160314715578,
                               places=7)

        self.assertAlmostEqual(oetf_DICOMGSDF(130.0662, out_int=True),
                               512,
                               places=7)