예제 #1
0
    def test_nan_eotf_DICOMGSDF(self):
        """
        Tests :func:`colour.models.rgb.transfer_functions.dicom_gsdf.\
eotf_DICOMGSDF` definition nan support.
        """

        eotf_DICOMGSDF(np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
예제 #2
0
    def test_nan_eotf_DICOMGSDF(self):
        """
        Tests :func:`colour.models.rgb.transfer_functions.dicom_gsdf.\
eotf_DICOMGSDF` definition nan support.
        """

        eotf_DICOMGSDF(np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
예제 #3
0
    def test_domain_range_scale_eotf_DICOMGSDF(self):
        """
        Tests :func:`colour.models.rgb.transfer_functions.dicom_gsdf.\
eotf_DICOMGSDF` definition domain and range scale support.
        """

        J = 0.500486263438448
        L = eotf_DICOMGSDF(J)

        d_r = (('reference', 1), (1, 1), (100, 100))
        for scale, factor in d_r:
            with domain_range_scale(scale):
                np.testing.assert_almost_equal(
                    eotf_DICOMGSDF(J * factor), L * factor, decimal=7)
예제 #4
0
    def test_domain_range_scale_eotf_DICOMGSDF(self):
        """
        Tests :func:`colour.models.rgb.transfer_functions.dicom_gsdf.\
eotf_DICOMGSDF` definition domain and range scale support.
        """

        J = 0.500486263438448
        L = eotf_DICOMGSDF(J)

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

        self.assertAlmostEqual(eotf_DICOMGSDF(1), 0.049981846913482, places=7)

        self.assertAlmostEqual(eotf_DICOMGSDF(512),
                               130.065284012159790,
                               places=7)

        self.assertAlmostEqual(eotf_DICOMGSDF(1023),
                               3993.329585887327100,
                               places=7)
예제 #6
0
    def test_eotf_DICOMGSDF(self):
        """
        Tests :func:`colour.models.rgb.transfer_functions.dicom_gsdf.\
eotf_DICOMGSDF` definition.
        """

        self.assertAlmostEqual(
            eotf_DICOMGSDF(0.001007281350787), 0.050143440671692, places=7)

        self.assertAlmostEqual(
            eotf_DICOMGSDF(0.500486263438448), 130.062864706476550, places=7)

        self.assertAlmostEqual(
            eotf_DICOMGSDF(1.000160314715578), 3997.586161113322300, places=7)

        self.assertAlmostEqual(
            eotf_DICOMGSDF(512, in_int=True), 130.065284012159790, places=7)
예제 #7
0
    def test_eotf_DICOMGSDF(self):
        """
        Tests :func:`colour.models.rgb.transfer_functions.dicom_gsdf.\
eotf_DICOMGSDF` definition.
        """

        self.assertAlmostEqual(
            eotf_DICOMGSDF(0.001007281350787), 0.050143440671692, places=7)

        self.assertAlmostEqual(
            eotf_DICOMGSDF(0.500486263438448), 130.062864706476550, places=7)

        self.assertAlmostEqual(
            eotf_DICOMGSDF(1.000160314715578), 3997.586161113322300, places=7)

        self.assertAlmostEqual(
            eotf_DICOMGSDF(512, in_int=True), 130.065284012159790, places=7)
예제 #8
0
    def test_n_dimensional_eotf_DICOMGSDF(self):
        """
        Tests :func:`colour.models.rgb.transfer_functions.dicom_gsdf.\
eotf_DICOMGSDF` definition n-dimensional arrays support.
        """

        J = 0.500486263438448
        L = eotf_DICOMGSDF(J)

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

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

        J = np.reshape(J, (2, 3, 1))
        L = np.reshape(L, (2, 3, 1))
        np.testing.assert_almost_equal(eotf_DICOMGSDF(J), L, decimal=7)
예제 #9
0
    def test_n_dimensional_eotf_DICOMGSDF(self):
        """
        Tests :func:`colour.models.rgb.transfer_functions.dicom_gsdf.\
eotf_DICOMGSDF` definition n-dimensional arrays support.
        """

        J = 0.500486263438448
        L = eotf_DICOMGSDF(J)

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

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

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