def __set_pure_state__(self, state): self.volume_mapper_type = state['_volume_mapper_type'] state_pickler.set_state(self, state, ignore=['ctf_state']) ctf_state = state['ctf_state'] ctf, otf = load_ctfs(ctf_state, self._volume_property) self._ctf = ctf self._otf = otf self._update_ctf_fired()
def test_save_load_ctf(self): """Test saving and loading of a CTF.""" # Create a default ctf, save it. data = save_ctfs(self.vp) # load it into another volume property, mvp = tvtk.VolumeProperty() ctf = load_ctfs(data, mvp) # get the data from the new one mdata = save_ctfs(mvp) # check that both the data are identical. self.assertEqual(mdata, data)