def set_reference_image(self, reference_image): """Set reference image.""" if not isinstance(reference_image, SIRF.ImageData): raise AssertionError() self.reference_image = reference_image parms.set_parameter(self.handle, self.name, 'reference_image', reference_image.handle)
def set_reference_image(self, reference_image): """Set reference image. This is the image that would be the reference if you were doing a forward transformation.""" if not isinstance(reference_image, SIRF.ImageData): raise AssertionError() self.reference_image = reference_image parms.set_parameter(self.handle, self.name, 'reference_image', reference_image.handle)
def set_initial_affine_transformation(self, src): """Set initial affine transformation.""" if not isinstance(src, AffineTransformation): raise AssertionError() parms.set_parameter(self.handle, self.name, 'initial_affine_transformation', src.handle)
def get_max(self): """Get max.""" return parms.float_par(self.handle, 'NiftiImageData', 'max')
def get_output(self): """Get output.""" image = NiftiImageData() image.handle = parms.parameter_handle(self.handle, self.name, 'output') check_status(image.handle) return image
def set_padding_value(self, val): """Set padding value.""" parms.set_float_par(self.handle, self.name, 'padding', val)
def set_interpolation_type_to_cubic_spline(self): """Set interpolation type to cubic spline.""" parms.set_int_par(self.handle, self.name, 'interpolation_type', 3)
def set_interpolation_type_to_nearest_neighbour(self): """Set interpolation type to nearest neighbour.""" parms.set_int_par(self.handle, self.name, 'interpolation_type', 0)
def set_floating_image(self, floating_image): """Sets the floating image.""" if not isinstance(floating_image, SIRF.ImageData): raise AssertionError() parms.set_parameter(self.handle, 'Registration', 'floating_image', floating_image.handle)
def set_parameter_file(self, filename): """Sets the parameter filename.""" parms.set_char_par(self.handle, 'Registration', 'parameter_file', filename)
def get_contains_nans(self): """Returns true if image contains any voxels with NaNs.""" return parms.bool_par(self.handle, 'NiftiImageData', 'contains_nans')
def get_sum(self): """Get sum.""" return parms.float_par(self.handle, 'NiftiImageData', 'sum')
def get_standard_deviation(self): """Get standard deviation.""" return parms.float_par(self.handle, 'NiftiImageData', 'std')
def get_variance(self): """Get variance.""" return parms.float_par(self.handle, 'NiftiImageData', 'variance')
def get_mean(self): """Get mean.""" return parms.float_par(self.handle, 'NiftiImageData', 'mean')
def set_floating_image(self, floating_image): """Set floating image. This is the image that would be the floating if you were doing a forward transformation.""" if not isinstance(floating_image, SIRF.ImageData): raise AssertionError() self.floating_image = floating_image parms.set_parameter(self.handle, self.name, 'floating_image', floating_image.handle)
def set_interpolation_type(self, interp_type): """Set interpolation type. 0=nearest neighbour, 1=linear, 3=cubic, 4=sinc.""" if not isinstance(interp_type, int): raise AssertionError() parms.set_int_par(self.handle, self.name, 'interpolation_type', interp_type)
def set_reference_mask(self, reference_mask): """Sets the reference mask.""" if not isinstance(reference_mask, SIRF.ImageData): raise AssertionError() parms.set_parameter(self.handle, 'Registration', 'reference_mask', reference_mask.handle)
def set_interpolation_type_to_linear(self): """Set interpolation type to linear.""" parms.set_int_par(self.handle, self.name, 'interpolation_type', 1)
def set_floating_mask(self, floating_mask): """Sets the floating mask.""" if not isinstance(floating_mask, SIRF.ImageData): raise AssertionError() parms.set_parameter(self.handle, 'Registration', 'floating_mask', floating_mask.handle)
def set_interpolation_type_to_sinc(self): """Set interpolation type to sinc.""" parms.set_int_par(self.handle, self.name, 'interpolation_type', 4)
def get_output(self): """Gets the registered image.""" output = self.reference_image.same_object() output.handle = parms.parameter_handle(self.handle, 'Registration', 'output') return output
def get_output(self): """Get output.""" image = self.reference_image.same_object() image.handle = parms.parameter_handle(self.handle, self.name, 'output') check_status(image.handle) return image
def set_floating_time_point(self, floating_time_point): """Set floating time point.""" parms.set_int_par(self.handle, self.name, 'floating_time_point', floating_time_point)
def get_determinant(self): """Get determinant.""" return parms.float_par(self.handle, self.name, 'determinant')
def set_reference_time_point(self, reference_time_point): """Set reference time point.""" parms.set_int_par(self.handle, self.name, 'reference_time_point', reference_time_point)