torchio/transforms/preprocessing/spatial/resample.py
def parse_target(
            self,
            target: Union[TypeSpacing, str],
            ) -> TypeTarget:
        """
        If target is an existing path, return a torchio.ScalarImage
        If it does not exist, return the string
        If it is not a Path or string, return None
        """
        if isinstance(target, (str, Path)):
            if Path(target).is_file():
                path = target
                reference_image = ScalarImage(path)
            else:
                reference_image = target
            target_spacing = None
        else:
            reference_image = None
            target_spacing = self.parse_spacing(target)
        return reference_image, target_spacing

        If target is an existing path, return a torchio.ScalarImage
        If it does not exist, return the string
        If it is not a Path or string, return None
        
If target is an existing path, return a torchio.ScalarImage
If it does not exist, return the string
If it is not a Path or string, return None
If target is an existing path return a torchio . ScalarImage If it does not exist return the string If it is not a Path or string return None
def parse_target(
            self,
            target: Union[TypeSpacing, str],
            ) -> TypeTarget:
        if isinstance(target, (str, Path)):
            if Path(target).is_file():
                path = target
                reference_image = ScalarImage(path)
            else:
                reference_image = target
            target_spacing = None
        else:
            reference_image = None
            target_spacing = self.parse_spacing(target)
        return reference_image, target_spacing
def parse_target ( self , target : Union [ TypeSpacing , str ] , ) -> TypeTarget : if isinstance ( target , ( str , Path ) ) : if Path ( target ) . is_file ( ) : path = target reference_image = ScalarImage ( path ) else : reference_image = target target_spacing = None else : reference_image = None target_spacing = self . parse_spacing ( target ) return reference_image , target_spacing
If target is an existing path, return a torchio.ScalarImage
If it does not exist, return the string
If it is not a Path or string, return None
If target is an existing path return a torchio . ScalarImage If it does not exist return the string If it is not a Path or string return None
"""
        If target is an existing path, return a torchio.ScalarImage
        If it does not exist, return the string
        If it is not a Path or string, return None
        """
self
target
Union[TypeSpacing, str]