Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mideface #3

Open
vferat opened this issue Jul 3, 2023 · 0 comments
Open

Add mideface #3

vferat opened this issue Jul 3, 2023 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@vferat
Copy link
Collaborator

vferat commented Jul 3, 2023

generate_docker.sh

             --freesurfer version=7.4.1 \

defacing_algorithms.py

def mideface_cmd(in_file, out_file):
    """
    Setup mideface command.

    Parameters
    ----------
    image : str
        Path to image that should be defaced.
    outfile : str
        Name of the defaced file.
    """
    from subprocess import check_call

    cmd = [
        "deepdefacer",
        "--i",
        in_file,
        "--o",
        out_file,
    ]
    check_call(cmd)
    return out_file


def run_mideface(in_file, out_file):
    """
    Setup and run mridefacer workflow.

    Parameters
    ----------
    image : str
        Path to image that should be defaced.
    subject_label : str
        Label of subject to operate on (without 'sub-').
    bids_dir : str
        Path to BIDS root directory.
    """
    mideface = pe.Node(
        Function(
            input_names=["in_file", "out_file"],
            output_names=["out_file"],
            function=deepdefacer_cmd,
        ),
        name="mideface",
    )
    mideface.inputs.in_file = in_file
    mideface.inputs.out_file = out_file
    results = mideface.run()
    out_file = results.outputs.out_file
    return out_file
@vferat vferat added enhancement New feature or request help wanted Extra attention is needed labels Jul 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant