Ejemplo n.º 1
0
    def get_slices_dirs_for_processing(path_to_data,
                                       slice_path_format,
                                       process_all=False):
        potential_paths_for_processing = Utils.get_slices_dirs(
            path_to_data, slice_path_format)

        sf = SlicemapFactory()

        paths_for_processing = []

        for potential_path in potential_paths_for_processing:
            if (sf.isExist(potential_path) == True):
                slicemap_obj = sf.get(potential_path)
                if ((slicemap_obj.done == False or os.path.isdir(
                        slicemap_obj.path_to_slicemaps_config_and_cache)
                     == False) and slicemap_obj.creation_going == False
                        or process_all):
                    paths_for_processing.append(potential_path)

            else:
                slicemap_obj = sf.init(
                    potential_path, Settings.SLICE_NAME_FORMAT,
                    Settings.SLICEMAP_NAME_FORMAT,
                    Settings.VISUALIZATION_CONFIG_NAME_FORMAT,
                    Settings.SLICEMAP_ROWS, Settings.SLICEMAP_COLS,
                    Settings.SLICEMAP_SIZE_WIDTH,
                    Settings.SLICEMAP_SIZE_HEIGHT)
                paths_for_processing.append(potential_path)

        return paths_for_processing
Ejemplo n.º 2
0
    def get_slicemaps(path_to_data, slice_path_format):
        potential_paths_for_processing = Utils.get_slices_dirs(path_to_data, slice_path_format)

        sf = SlicemapFactory()

        processed_slicedmaps = []

        for potential_path in potential_paths_for_processing:
            if( sf.isExist( potential_path ) == True):
                slicemap_obj = sf.get( potential_path )
                processed_slicedmaps.append( slicemap_obj )

        return processed_slicedmaps
Ejemplo n.º 3
0
    def show_preview(self, path_to_slices):
        sf = SlicemapFactory()

        if (sf.isExist(path_to_slices) == True):
            slicemap_obj = sf.get(path_to_slices)
            if (slicemap_obj.done == True and slicemap_obj.has_error == False):
                return render_template('show_preview.html',
                                       {'slicemap_obj': slicemap_obj})
            if (slicemap_obj.done == False
                    and slicemap_obj.creation_going == True):
                return "Processing slices still going..."
        else:
            return "Preview for volume on the path: %s not found." % path_to_slices
Ejemplo n.º 4
0
    def get_slicemaps(path_to_data, slice_path_format):
        potential_paths_for_processing = Utils.get_slices_dirs(
            path_to_data, slice_path_format)

        sf = SlicemapFactory()

        processed_slicedmaps = []

        for potential_path in potential_paths_for_processing:
            if (sf.isExist(potential_path) == True):
                slicemap_obj = sf.get(potential_path)
                processed_slicedmaps.append(slicemap_obj)

        return processed_slicedmaps
Ejemplo n.º 5
0
    def get_slices_dirs_for_processing(path_to_data, slice_path_format, process_all=False):
        potential_paths_for_processing = Utils.get_slices_dirs(path_to_data, slice_path_format)

        sf = SlicemapFactory()

        paths_for_processing = []

        for potential_path in potential_paths_for_processing:
            if( sf.isExist( potential_path ) == True):
                slicemap_obj = sf.get( potential_path )
                if( (slicemap_obj.done == False or os.path.isdir( slicemap_obj.path_to_slicemaps_config_and_cache ) == False) and slicemap_obj.creation_going == False or process_all ):
                    paths_for_processing.append( potential_path )

            else:
                slicemap_obj = sf.init(potential_path, Settings.SLICE_NAME_FORMAT, Settings.SLICEMAP_NAME_FORMAT, Settings.VISUALIZATION_CONFIG_NAME_FORMAT, Settings.SLICEMAP_ROWS, Settings.SLICEMAP_COLS, Settings.SLICEMAP_SIZE_WIDTH, Settings.SLICEMAP_SIZE_HEIGHT)
                paths_for_processing.append( potential_path )

        return paths_for_processing
Ejemplo n.º 6
0
    def is_preview_exist(self, path_to_slices):
        sf = SlicemapFactory()

        if (sf.isExist(path_to_slices) == True):
            slicemap_obj = sf.get(path_to_slices)
            status = {
                "exist": True,
                "done": slicemap_obj.done,
                "creation_going": slicemap_obj.creation_going,
                "has_error": slicemap_obj.has_error,
                "link": Utils.create_link_for_preview(path_to_slices)
            }
        else:
            status = {
                "exist": False,
            }

        return status