lama/registration_pipeline/validate_config.py
def check_images(self):
        """
        validate that image paths are correct and give loadeable volumes

        For now just check for spaces in filenames
        """

        img_dir = self.options['inputs']

        # Inputs is a folder
        if os.path.isdir(img_dir):
            imgs = os.listdir(img_dir)

        # Inputs is a list of paths
        elif os.path.isfile(img_dir):
            imgs = common.get_inputs_from_file_list(img_dir, self.config_dir)
        else:
            logging.error("'inputs' directory should be in same directory as config and should contain images or a file "
                          "containing image paths")
            sys.exit(1)
        logging.info('validating input volumes')

        dtypes = {}

        for im_name in imgs:
            image_path = join(img_dir, im_name)

            self.space_filename_check(image_path)

        #     array_load = common.LoadImage(image_path)
        #     if not array_load:
        #         logging.error(array_load.error_msg)
        #         raise FileNotFoundError(f'cannot load {image_path}')
        #
        #     self.check_dtype(self.config, array_load.array, array_load.img_path)
        #     self.check_16bit_elastix_parameters_set(self.config, array_load.array)
        #     dtypes[im_name] = array_load.array.dtype
        #
        # if len(set(dtypes.values())) > 1:
        #     dtype_str = ""
        #     for k, v in list(dtypes.items()):
        #         dtype_str += k + ':\t' + str(v) + '\n'
        #     logging.warning('The input images have a mixture of data types\n{}'.format(dtype_str))

        validate that image paths are correct and give loadeable volumes

        For now just check for spaces in filenames
        
validate that image paths are correct and give loadeable volumes
For now just check for spaces in filenames
validate that image paths are correct and give loadeable volumes For now just check for spaces in filenames
def check_images(self):
        img_dir = self.options['inputs']
        if os.path.isdir(img_dir):
            imgs = os.listdir(img_dir)
        elif os.path.isfile(img_dir):
            imgs = common.get_inputs_from_file_list(img_dir, self.config_dir)
        else:
            logging.error("'inputs' directory should be in same directory as config and should contain images or a file "
                          "containing image paths")
            sys.exit(1)
        logging.info('validating input volumes')
        dtypes = {}
        for im_name in imgs:
            image_path = join(img_dir, im_name)
            self.space_filename_check(image_path)
             self.check_dtype(self.config, array_load.array, array_load.img_path)
             self.check_16bit_elastix_parameters_set(self.config, array_load.array)
             dtypes[im_name] = array_load.array.dtype
         if len(set(dtypes.values())) > 1:
             dtype_str = ""
             for k, v in list(dtypes.items()):
                 dtype_str += k + ':\t' + str(v) + '\n'
             logging.warning('The input images have a mixture of data types\n{}'.format(dtype_str))
def check_images ( self ) : img_dir = self . options [ 'inputs' ] if os . path . isdir ( img_dir ) : imgs = os . listdir ( img_dir ) elif os . path . isfile ( img_dir ) : imgs = common . get_inputs_from_file_list ( img_dir , self . config_dir ) else : logging . error ( "'inputs' directory should be in same directory as config and should contain images or a file " "containing image paths" ) sys . exit ( 1 ) logging . info ( 'validating input volumes' ) dtypes = { } for im_name in imgs : image_path = join ( img_dir , im_name ) self . space_filename_check ( image_path )
validate that image paths are correct and give loadeable volumes
For now just check for spaces in filenames
validate that image paths are correct and give loadeable volumes For now just check for spaces in filenames
"""
        validate that image paths are correct and give loadeable volumes

        For now just check for spaces in filenames
        """ # Inputs is a folder # Inputs is a list of paths #     array_load = common.LoadImage(image_path) #     if not array_load: #         logging.error(array_load.error_msg) #         raise FileNotFoundError(f'cannot load {image_path}') # #     self.check_dtype(self.config, array_load.array, array_load.img_path) #     self.check_16bit_elastix_parameters_set(self.config, array_load.array) #     dtypes[im_name] = array_load.array.dtype # # if len(set(dtypes.values())) > 1: #     dtype_str = "" #     for k, v in list(dtypes.items()): #         dtype_str += k + ':\t' + str(v) + '\n' #     logging.warning('The input images have a mixture of data types\n{}'.format(dtype_str))
self