def setUp(self):
        self.msi = helpers.getFakeMsi()
        self.specialmsi = helpers.getFakeMsi()

        # set one pixel to special values
        self.specialValue = np.arange(self.specialmsi.get_image().shape[-1]) * 2
        self.specialmsi.get_image()[2, 2, :] = self.specialValue

        # create a segmentation which sets all elements to invalid but the
        # one pixel with the special value
        self.segmentation = np.zeros(self.specialmsi.get_image().shape[0:-1])
        self.segmentation[2, 2] = 1
Exemple #2
0
    def test_imageWriterCreatesCorrectFile(self):
        writer = TiffWriter(self.msi, convert_to_nm=False)
        writer.write(self.fileUriToWrite)

        reader = TiffReader(shift_bits=0)
        msi = reader.read(self.fileUriToWrite)
        self.assertTrue(msi == helpers.getFakeMsi(),
                        "image correctly written and read")
Exemple #3
0
    def test_imageWriterCreatesCorrectFile(self):
        writer = TiffWriter(self.msi, convert_to_nm=False)
        writer.write(self.fileUriToWrite)

        reader = TiffReader(shift_bits=0)
        msi = reader.read(self.fileUriToWrite)
        self.assertTrue(msi == helpers.getFakeMsi(),
                                       "image correctly written and read")
Exemple #4
0
    def test_imageWriterCreatesCorrectFile(self):

        writer = NrrdWriter(self.msi)
        writer.write(self.fileUriToWrite)

        reader = NrrdReader()
        msi = reader.read(self.fileUriToWrite)
        self.assertTrue(msi == helpers.getFakeMsi(),
                                       "image correctly written and read")
Exemple #5
0
 def setUp(self):
     # setup file and the path where it shall be written to
     self.msi = helpers.getFakeMsi()
     self.fileUriToWrite = "testfile.nrrd"
Exemple #6
0
 def setUp(self):
     self.msi = helpers.getFakeMsi()
     self.test_file_path = "test_msi.msi"
Exemple #7
0
 def setUp(self):
     # setup file and the path where it shall be written to
     self.msi = helpers.getFakeMsi()
     self.msi.set_image(self.msi.get_image())
     self.fileUriToWrite = os.path.join(os.getcwd(), "testfiles")
 def setUp(self):
     self.specialmsi = helpers.getFakeMsi()
     # set one pixel to special values
     self.specialValue = np.arange(
         self.specialmsi.get_image().shape[-1]) * 2
     self.specialmsi.get_image()[2, 2, :] = self.specialValue
Exemple #9
0
 def setUp(self):
     self.msi = helpers.getFakeMsi()
Exemple #10
0
 def setUp(self):
     self.specialmsi = helpers.getFakeMsi()
     # set one pixel to special values
     self.specialValue = np.arange(self.specialmsi.get_image().shape[-1]) * 2
     self.specialmsi.get_image()[2, 2, :] = self.specialValue