本文整理汇总了Python中nipype.pipeline.engine.Workflow.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Workflow.__init__方法的具体用法?Python Workflow.__init__怎么用?Python Workflow.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nipype.pipeline.engine.Workflow
的用法示例。
在下文中一共展示了Workflow.__init__方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from nipype.pipeline.engine import Workflow [as 别名]
# 或者: from nipype.pipeline.engine.Workflow import __init__ [as 别名]
def __init__(self, ct_file_name, tmp_dir, chest_regions=None):
Workflow.__init__(self, 'VesselParticlesWorkflow')
assert ct_file_name.rfind('.') != -1, "Unrecognized CT file name format"
self._tmp_dir = tmp_dir
self._cid = ct_file_name[max([ct_file_name.rfind('/'), 0])+1:\
ct_file_name.rfind('.')]
if ct_file_name.rfind('/') != -1:
self._dir = ct_file_name[0:ct_file_name.rfind('/')]
else:
self._dir = '.'
if vessel_seeds_mask_file_name is None:
self._vessel_seeds_mask_file_name = \
os.path.join(self._dir, self._cid + CM._vesselSeedsMask)
else:
self._vessel_seeds_mask_file_name = vessel_seeds_mask_file_name
generate_partial_lung_label_map = \
pe.Node(interface=cip.GeneratePartialLungLabelMap(),
name='generate_partial_lung_label_map')
generate_partial_lung_label_map.inputs.ct = ct_file_name
generate_partial_lung_label_map.inputs.
extract_chest_label_map = \
pe.Node(interface=cip.ExtractChestLabelMap(),
name='extract_chest_label_map')
extract_chest_label_map.inputs.outFileName =
extract_chest_label_map.inputs.
示例2: __init__
# 需要导入模块: from nipype.pipeline.engine import Workflow [as 别名]
# 或者: from nipype.pipeline.engine.Workflow import __init__ [as 别名]
def __init__(self,name,input_fields=None,output_fields=None,**kwargs):
Workflow.__init__(self,name=name,**kwargs)
if input_fields:
self.input_node = pe.Node(name = 'input',
interface = util.IdentityInterface(fields=input_fields))
if output_fields:
self.output_node = pe.Node(name = 'output',
interface = util.IdentityInterface(fields=output_fields))
示例3: __init__
# 需要导入模块: from nipype.pipeline.engine import Workflow [as 别名]
# 或者: from nipype.pipeline.engine.Workflow import __init__ [as 别名]
def __init__(self, ct_file_name, label_map_file_name,
tmp_dir, vessel_seeds_mask_file_name=None):
Workflow.__init__(self, 'VesselParticlesMaskWorkflow')
assert ct_file_name.rfind('.') != -1, "Unrecognized CT file name format"
self._tmp_dir = tmp_dir
self._cid = ct_file_name[max([ct_file_name.rfind('/'), 0])+1:\
ct_file_name.rfind('.')]
if ct_file_name.rfind('/') != -1:
self._dir = ct_file_name[0:ct_file_name.rfind('/')]
else:
self._dir = '.'
if vessel_seeds_mask_file_name is None:
self._vessel_seeds_mask_file_name = \
os.path.join(self._dir, self._cid + CM._vesselSeedsMask)
else:
self._vessel_seeds_mask_file_name = vessel_seeds_mask_file_name
# Params for feature strength computation
self._ct_file_name = ct_file_name
self._label_map_file_name = label_map_file_name
self._distance_map_file_name = \
os.path.join(self._tmp_dir, self._cid + '_distanceMap.nhdr')
self._feature_mask_file_name = \
os.path.join(self._tmp_dir, self._cid + '_featureMask.nhdr')
self._masked_strength_file_name = \
os.path.join(self._tmp_dir, self._cid + '_maskedStrength.nhdr')
self._equalized_strength_file_name = \
os.path.join(self._tmp_dir, self._cid + '_equalized.nhdr')
self._thresholded_equalized_file_name = \
os.path.join(self._tmp_dir, self._cid + '_thresholded.nhdr')
self._converted_thresholded_equalized_file_name = \
os.path.join(self._tmp_dir, self._cid + '_converted.nhdr')
self._strength_file_name = \
os.path.join(self._tmp_dir, self._cid + '_strength.nhdr')
self._scale_file_name = \
os.path.join(self._tmp_dir, self._cid + '_scale.nhdr')
self._thinned_file_name = \
os.path.join(self._tmp_dir, self._cid + '_thinned.nhdr')
self._sigma_step_method = 1
self._rescale = False
self._threads = 0
self._method = 'Frangi'
self._alpha = 0.63 # In [0, 1]
self._beta = 0.51 # In [0. 1]
self._C = 245 # In [0, 300]
self._alphase = 0.25 # In [0, 1]
self._nu = 0 # In [-1, 0.5]
self._kappa = 0.5 # In [0.01, 2]
self._betase = 0.1 # In [0.01, 2]
self._sigma = 1.0
self._sigma_min = 0.7
self._sigma_max = 4.0
self._num_steps = 7
self._gaussianStd = [self._sigma_min, self._sigma_max, self._num_steps]
# Params for histogram equalization (unu heq node)
self._bin = 10000
self._amount = 0.96
self._smart = 5
# Param for thresholding the histogram-equalized strength image
self._vesselness_th = 0.5
# Params for 'unu_2op_lt' node
self._distance_from_wall = -2.0
# Create distance map node. We want to isolate a region that is
# not too close to the lung periphery (particles can pick up noise in
# that region)
compute_distance_transform = \
pe.Node(interface=cip.ComputeDistanceMap(),
name='compute_distance_transform')
compute_distance_transform.inputs.labelMap = self._label_map_file_name
compute_distance_transform.inputs.distanceMap = \
self._distance_map_file_name
# Create node for thresholding the distance map
unu_2op_lt = pe.Node(interface=unu.unu_2op(), name='unu_2op_lt')
unu_2op_lt.inputs.operator = 'lt'
unu_2op_lt.inputs.type = 'short'
unu_2op_lt.inputs.in2_scalar = self._distance_from_wall
unu_2op_lt.inputs.output = self._feature_mask_file_name
# Create node for generating the vesselness feature strength image
compute_feature_strength = \
pe.Node(interface=cip.ComputeFeatureStrength(),
name='compute_feature_strength')
compute_feature_strength.inputs.inFileName = self._ct_file_name
compute_feature_strength.inputs.outFileName = self._strength_file_name
compute_feature_strength.inputs.ssm = self._sigma_step_method
compute_feature_strength.inputs.rescale = self._rescale
compute_feature_strength.inputs.threads = self._threads
compute_feature_strength.inputs.method = self._method
compute_feature_strength.inputs.feature = 'RidgeLine'
compute_feature_strength.inputs.alpha = self._alpha
compute_feature_strength.inputs.beta = self._beta
#.........这里部分代码省略.........