def test_Threshold_outputs(): output_map = dict(activation_forced=dict(), cluster_forming_thr=dict(), n_clusters=dict(), pre_topo_fdr_map=dict(), pre_topo_n_clusters=dict(), thresholded_map=dict(), ) outputs = Threshold.output_spec() for key, metadata in output_map.items(): for metakey, value in metadata.items(): yield assert_equal, getattr(outputs.traits()[key], metakey), value
def test_Threshold_inputs(): input_map = dict(contrast_index=dict(mandatory=True, ), extent_fdr_p_threshold=dict(usedefault=True, ), extent_threshold=dict(usedefault=True, ), force_activation=dict(usedefault=True, ), height_threshold=dict(usedefault=True, ), height_threshold_type=dict(usedefault=True, ), ignore_exception=dict(nohash=True, usedefault=True, ), matlab_cmd=dict(), mfile=dict(usedefault=True, ), paths=dict(), spm_mat_file=dict(copyfile=True, mandatory=True, ), stat_image=dict(copyfile=False, mandatory=True, ), use_fwe_correction=dict(usedefault=True, ), use_mcr=dict(), use_topo_fdr=dict(usedefault=True, ), use_v8struct=dict(min_ver='8', usedefault=True, ), ) inputs = Threshold.input_spec() for key, metadata in input_map.items(): for metakey, value in metadata.items(): yield assert_equal, getattr(inputs.traits()[key], metakey), value
output_names=['out_path'], function=plot_stat_maps), name='plot_contrasts', iterfield=['thresh']) # input: plot data with set of different thresholds: plot_contrasts.inputs.thresh = [None, 1, 2, 3] # set expected thread and memory usage for the node: plot_contrasts.interface.num_threads = 1 plot_contrasts.interface.mem_gb = 0.2 # ====================================================================== # DEFINE NODE: THRESHOLD # ====================================================================== # function: Topological FDR thresholding based on cluster extent/size. # Smoothness is estimated from GLM residuals but is assumed to be the # same for all of the voxels. thresh = Node(Threshold(), name="thresh") # input: whether to use FWE (Bonferroni) correction for initial threshold # (a boolean, nipype default value: True): thresh.inputs.use_fwe_correction = False # input: whether to use FDR over cluster extent probabilities (boolean) thresh.inputs.use_topo_fdr = True # input: value for initial thresholding (defining clusters): thresh.inputs.height_threshold = 0.05 # input: is the cluster forming threshold a stat value or p-value? # ('p-value' or 'stat', nipype default value: p-value): thresh.inputs.height_threshold_type = 'p-value' # input: which contrast in the SPM.mat to use (an integer): thresh.inputs.contrast_index = 1 # input: p threshold on FDR corrected cluster size probabilities (float): thresh.inputs.extent_fdr_p_threshold = 0.05 # input: minimum cluster size in voxels (an integer, default = 0):