def _add_provenance(in_file, settings, air_msk, rot_msk): from mriqc import __version__ as version from niworkflows.nipype.utils.filemanip import hash_infile import nibabel as nb import numpy as np air_msk_size = nb.load(air_msk).get_data().astype( np.uint8).sum() rot_msk_size = nb.load(rot_msk).get_data().astype( np.uint8).sum() out_prov = { 'md5sum': hash_infile(in_file), 'version': version, 'software': 'mriqc', 'warnings': { 'small_air_mask': bool(air_msk_size < 5e5), 'large_rot_frame': bool(rot_msk_size > 500), } } if settings: out_prov['settings'] = settings return out_prov
def _add_provenance(in_file, settings, air_msk, rot_msk): from mriqc import __version__ as version from niworkflows.nipype.utils.filemanip import hash_infile import nibabel as nb import numpy as np air_msk_size = nb.load(air_msk).get_data().astype( np.uint8).sum() rot_msk_size = nb.load(rot_msk).get_data().astype( np.uint8).sum() out_prov = { 'md5sum': hash_infile(in_file), 'version': version, 'software': 'mriqc', 'warnings': { 'small_air_mask': bool(air_msk_size < 5e5), 'large_rot_frame': bool(rot_msk_size > 500), } } if settings: out_prov['settings'] = settings return out_prov
def main(): """Entry point""" from fmriprep.workflows.bold.util import init_bold_reference_wf opts = get_parser().parse_args() wf = init_bold_reference_wf(1, name=hash_infile(opts.input_file), gen_report=True) wf.inputs.inputnode.bold_file = opts.input_file wf.base_dir = os.getcwd() wf.run()
def _add_provenance(in_file, settings): from mriqc import __version__ as version from niworkflows.nipype.utils.filemanip import hash_infile out_prov = { 'md5sum': hash_infile(in_file), 'version': version, 'software': 'mriqc' } if settings: out_prov['settings'] = settings return out_prov
def _add_provenance(in_file, settings): from mriqc import __version__ as version from niworkflows.nipype.utils.filemanip import hash_infile out_prov = { 'md5sum': hash_infile(in_file), 'version': version, 'software': 'mriqc' } if settings: out_prov['settings'] = settings return out_prov