def get_image(self, image, output='<STR_LIT>'):
if isinstance(image, string_types):<EOL><INDENT>image = nb.load(image)<EOL><DEDENT>if type(image).__module__.startswith('<STR_LIT>'):<EOL><INDENT>if output == '<STR_LIT:image>':<EOL><INDENT>return image<EOL><DEDENT>image = image.get_data()<EOL><DEDENT>if not type(image).__module__.startswith('<STR_LIT>'):<EOL><INDENT>raise ValueError("<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT>if image.shape[:<NUM_LIT:3>] == self.volume.shape:<EOL><INDENT>if output == '<STR_LIT:image>':<EOL><INDENT>return nb.nifti1.Nifti1Image(image, None, self.get_header())<EOL><DEDENT>elif output == '<STR_LIT>':<EOL><INDENT>return image<EOL><DEDENT>else:<EOL><INDENT>image = image.ravel()<EOL><DEDENT><DEDENT>if output == '<STR_LIT>':<EOL><INDENT>return image.ravel()<EOL><DEDENT>image = np.reshape(image, self.volume.shape)<EOL>if output == '<STR_LIT>':<EOL><INDENT>return image<EOL><DEDENT>return nb.nifti1.Nifti1Image(image, None, self.get_header())<EOL>
A flexible method for transforming between different
        representations of image data.
        Args:
            image: The input image. Can be a string (filename of image),
                NiBabel image, N-dimensional array (must have same shape as
                self.volume), or vectorized image data (must have same length
                as current conjunction mask).
            output: The format of the returned image representation. Must be
                one of:
                    'vector': A 1D vectorized array
                    'array': An N-dimensional array, with
                        shape = self.volume.shape
                    'image': A NiBabel image
        Returns: An object containing image data; see output options above.