diff --git a/mriqc/workflows/diffusion/output.py b/mriqc/workflows/diffusion/output.py index 43c68b38..d6847086 100644 --- a/mriqc/workflows/diffusion/output.py +++ b/mriqc/workflows/diffusion/output.py @@ -216,160 +216,6 @@ def _gen_entity(inlist): ]) # fmt: on - - if True: - return workflow - - # Generate crown mask - # Create the crown mask - dilated_mask = pe.Node(BinaryDilation(), name='dilated_mask') - subtract_mask = pe.Node(BinarySubtraction(), name='subtract_mask') - parcels = pe.Node(niu.Function(function=_carpet_parcellation), name='parcels') - - bigplot = pe.Node(FMRISummary(), name='BigPlot', mem_gb=mem_gb * 3.5) - - ds_report_carpet = pe.Node( - DerivativesDataSink( - base_directory=reportlets_dir, - desc='carpet', - datatype='figures', - ), - name='ds_report_carpet', - run_without_submitting=True, - ) - - # fmt: off - workflow.connect([ - # (inputnode, rnode, [("in_iqms", "in_iqms")]), - (inputnode, bigplot, [('hmc_epi', 'in_func'), - ('hmc_fd', 'fd'), - ('fd_thres', 'fd_thres'), - ('in_dvars', 'dvars'), - ('outliers', 'outliers'), - (('meta_sidecar', _get_tr), 'tr')]), - (inputnode, parcels, [('epi_parc', 'segmentation')]), - (inputnode, dilated_mask, [('brain_mask', 'in_mask')]), - (inputnode, subtract_mask, [('brain_mask', 'in_subtract')]), - (dilated_mask, subtract_mask, [('out_mask', 'in_base')]), - (subtract_mask, parcels, [('out_mask', 'crown_mask')]), - (parcels, bigplot, [('out', 'in_segm')]), - (inputnode, ds_report_carpet, [('name_source', 'source_file')]), - (bigplot, ds_report_carpet, [('out_file', 'in_file')]), - ]) - # fmt: on - - if config.workflow.fft_spikes_detector: - mosaic_spikes = pe.Node( - PlotSpikes( - out_file='plot_spikes.svg', - cmap='viridis', - title='High-Frequency spikes', - ), - name='PlotSpikes', - ) - - ds_report_spikes = pe.Node( - DerivativesDataSink( - base_directory=reportlets_dir, - desc='spikes', - datatype='figures', - ), - name='ds_report_spikes', - run_without_submitting=True, - ) - - # fmt: off - workflow.connect([ - (inputnode, ds_report_spikes, [('name_source', 'source_file')]), - (inputnode, mosaic_spikes, [('in_ras', 'in_file'), - ('in_spikes', 'in_spikes'), - ('in_fft', 'in_fft')]), - (mosaic_spikes, ds_report_spikes, [('out_file', 'in_file')]), - ]) - # fmt: on - - if not verbose: - return workflow - - # Verbose-reporting goes here - from nireports.interfaces import PlotContours - - mosaic_zoom = pe.Node( - PlotMosaic( - cmap='Greys_r', - ), - name='PlotMosaicZoomed', - ) - - plot_bmask = pe.Node( - PlotContours( - display_mode='y' if config.workflow.species.lower() in ('rat', 'mouse') else 'z', - levels=[0.5], - colors=['r'], - cut_coords=10, - out_file='bmask', - ), - name='PlotBrainmask', - ) - - ds_report_zoomed = pe.Node( - DerivativesDataSink( - base_directory=reportlets_dir, - desc='zoomed', - datatype='figures', - ), - name='ds_report_zoomed', - run_without_submitting=True, - ) - - ds_report_background = pe.Node( - DerivativesDataSink( - base_directory=reportlets_dir, - desc='background', - datatype='figures', - ), - name='ds_report_background', - run_without_submitting=True, - ) - - ds_report_bmask = pe.Node( - DerivativesDataSink( - base_directory=reportlets_dir, - desc='brainmask', - datatype='figures', - ), - name='ds_report_bmask', - run_without_submitting=True, - ) - - ds_report_norm = pe.Node( - DerivativesDataSink( - base_directory=reportlets_dir, - desc='norm', - datatype='figures', - ), - name='ds_report_norm', - run_without_submitting=True, - ) - - # fmt: off - workflow.connect([ - (inputnode, ds_report_norm, [('mni_report', 'in_file'), - ('name_source', 'source_file')]), - (inputnode, plot_bmask, [('epi_mean', 'in_file'), - ('brain_mask', 'in_contours')]), - (inputnode, mosaic_zoom, [('epi_mean', 'in_file'), - ('brain_mask', 'bbox_mask_file')]), - (inputnode, mosaic_noise, [('epi_mean', 'in_file')]), - (inputnode, ds_report_zoomed, [('name_source', 'source_file')]), - (inputnode, ds_report_background, [('name_source', 'source_file')]), - (inputnode, ds_report_bmask, [('name_source', 'source_file')]), - (mosaic_zoom, ds_report_zoomed, [('out_file', 'in_file')]), - (mosaic_noise, ds_report_background, [('out_file', 'in_file')]), - (plot_bmask, ds_report_bmask, [('out_file', 'in_file')]), - ]) - # fmt: on - return workflow