File size: 831 Bytes
4f28aaa
 
44bc519
 
 
 
 
4f28aaa
545e839
 
44bc519
545e839
 
 
44bc519
545e839
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import subprocess as sp

from .logger import get_logger


LOGGER = get_logger()


def run_model(fixed_path=None, moving_path=None, fixed_seg_path=None, moving_seg_path=None, output_path=None, task="B"):
    if (fixed_seg_path is None) or (moving_seg_path is None):
        LOGGER.info("The fixed or moving segmentation were not provided and are thus ignored for inference.")
        sp.check_call(["ddmr", "-f", fixed_path, "-m", moving_path, \
                    "-o", output_path, "-a", task, "--model", "BL-NS", "--original-resolution"])
    else:
        LOGGER.info("All four inputs were successfully provided.")
        sp.check_call(["ddmr", "-f", fixed_path, "-m", moving_path, "-fs", fixed_seg_path, "-ms", moving_seg_path,
                    "-o", output_path, "-a", task, "--model", "BL-NS", "--original-resolution"])