def __init__(self, pixeltype='float', dimension=3, components=1, pointer=None, is_rgb=False, label_image=None):
        """
        Initialize an ANTsImage

        Arguments
        ---------
        pixeltype : string
            ITK pixeltype of image

        dimension : integer
            number of image dimension. Does NOT include components dimension

        components : integer
            number of pixel components in the image

        pointer : py::capsule (optional)
            pybind11 capsule holding the pointer to the underlying ITK image object

        label_image : LabelImage
            a discrete label image for mapping locations to atlas regions

        """
        ## Attributes which cant change without creating a new ANTsImage object
        self.pointer = pointer
        self.pixeltype = pixeltype
        self.dimension = dimension
        self.components = components
        self.has_components = self.components > 1
        self.dtype = _itk_to_npy_map[self.pixeltype]
        self.is_rgb = is_rgb

        self._pixelclass = 'vector' if self.has_components else 'scalar'
        self._shortpclass = 'V' if self._pixelclass == 'vector' else ''
        if is_rgb:
            self._pixelclass = 'rgb'
            self._shortpclass = 'RGB'

        self._libsuffix = '%s%s%i' % (self._shortpclass, utils.short_ptype(self.pixeltype), self.dimension)

        self.shape = utils.get_lib_fn('getShape%s'%self._libsuffix)(self.pointer)
        self.physical_shape = tuple([round(sh*sp,3) for sh,sp in zip(self.shape, self.spacing)])

        if label_image is not None:
            if not isinstance(label_image, LabelImage):
                raise ValueError('label_image argument must be a LabelImage type')
            self.label_image = label_image
def __init__ ( self , pixeltype = 'float' , dimension = 3 , components = 1 , pointer = None , is_rgb = False , label_image = None ) : self . pointer = pointer self . pixeltype = pixeltype self . dimension = dimension self . components = components self . has_components = self . components > 1 self . dtype = _itk_to_npy_map [ self . pixeltype ] self . is_rgb = is_rgb self . _pixelclass = 'vector' if self . has_components else 'scalar' self . _shortpclass = 'V' if self . _pixelclass == 'vector' else '' if is_rgb : self . _pixelclass = 'rgb' self . _shortpclass = 'RGB' self . _libsuffix = '%s%s%i' % ( self . _shortpclass , utils . short_ptype ( self . pixeltype ) , self . dimension ) self . shape = utils . get_lib_fn ( 'getShape%s' % self . _libsuffix ) ( self . pointer ) self . physical_shape = tuple ( [ round ( sh * sp , 3 ) for sh , sp in zip ( self . shape , self . spacing ) ] ) if label_image is not None : if not isinstance ( label_image , LabelImage ) : raise ValueError ( 'label_image argument must be a LabelImage type' ) self . label_image = label_image
Initialize an ANTsImage

        Arguments
        ---------
        pixeltype : string
            ITK pixeltype of image

        dimension : integer
            number of image dimension. Does NOT include components dimension

        components : integer
            number of pixel components in the image

        pointer : py::capsule (optional)
            pybind11 capsule holding the pointer to the underlying ITK image object

        label_image : LabelImage
            a discrete label image for mapping locations to atlas regions