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
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")
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")
def setUp(self): # setup file and the path where it shall be written to self.msi = helpers.getFakeMsi() self.fileUriToWrite = "testfile.nrrd"
def setUp(self): self.msi = helpers.getFakeMsi() self.test_file_path = "test_msi.msi"
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
def setUp(self): self.msi = helpers.getFakeMsi()
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