Source code for

import os
import logging

import tomopy
import numpy as np

__all__ = ['segment',]

log = logging.getLogger(__name__)

# this module will host post reconstuction data analysis (segmentation, etc.)

[docs]def segment(params): # slice/full reconstruction file location tail = os.sep + os.path.splitext(os.path.basename(params.hdf_file))[0]+ '_rec' + os.sep top = os.path.dirname(params.hdf_file) + '_rec' + tail # if os.path.isdir(top): rec_file_list = list(filter(lambda x: x.endswith(('.tiff', '.tif')), os.listdir(top))) rec_file_list.sort()'found in %s' % top)'files %s' % rec_file_list)'applying segmentation') log.warning('not implemented') else: log.error("ERROR: the directory %s does not exist" % top) log.error("ERROR: to create one run a full reconstruction first:") log.error("ERROR: $ tomopy recon --reconstruction-type full --hdf-file %s" % params.hdf_file)