The following functions facilitate the integration of binary executables that operate on images in the Analyze 7.5 file format with workflows based on the newer NIfTI-1 format.
Save the Analyze image at src_path as a NIfTI image to dst_path.
The canonical image orientation used by NiBabel is LPI.
Analyze images are assumed to be in stored in the radiological convention (corresponding to RPI), with the fastest-changing (x) axis increasing from right to left.
| Parameters: | 
  | 
|---|---|
| Returns: | The original Analyze header loaded from src_path  | 
Save the NIfTI image at src_path as an Analyze image to dst_path.
| Parameters: | 
  | 
|---|---|
| Returns: | The original NIfTI header loaded from src_path  | 
Run func (usually lambda: _run_interface(self, runtime)) of a Nipype CommandLine interface with inputs listed in input_names converted to temporary files in the Analyze 7.5 format before execution, and outputs listed in output_names converted back to NIfTI.
| Parameters: | 
  | 
|---|
Example usage in a class extending nipype.interfaces.base.CommandLine:
def _run_interface(self, runtime):
    runtime = run_with_analyze(self, 
        lambda: super(self.__class__, self)._run_interface(runtime),
        input_names=["input_image", "mask_image"],
        output_names=["output_image"]
    )
    if runtime.stderr:
        self.raise_exception(runtime)
    return runtime