Exemplo n.º 1
0
from kaapana.operators.LocalGetInputDataOperator import LocalGetInputDataOperator
from kaapana.operators.LocalMinioOperator import LocalMinioOperator
from kaapana.operators.LocalWorkflowCleanerOperator import LocalWorkflowCleanerOperator
from example.ExtractStudyIdOperator import ExtractStudyIdOperator
from example.PoolJsonsOperator import PoolJsonsOperator

log = LoggingMixin().log

args = {
    'ui_visible': True,
    'owner': 'kaapana',
    'start_date': days_ago(0),
    'retries': 0,
    'retry_delay': timedelta(seconds=30)
}

dag = DAG(dag_id='example-dcm-pool-study-ids',
          default_args=args,
          schedule_interval=None)

get_input = LocalGetInputDataOperator(dag=dag)
extract = ExtractStudyIdOperator(dag=dag)
pool_jsons = PoolJsonsOperator(dag=dag, input_operator=extract)
put_to_minio = LocalMinioOperator(dag=dag,
                                  action='put',
                                  action_operators=[pool_jsons])
clean = LocalWorkflowCleanerOperator(dag=dag, clean_workflow_dir=True)

get_input >> extract >> pool_jsons >> put_to_minio >> clean
Exemplo n.º 2
0
    'start_date': days_ago(0),
    'retries': 0,
    'retry_delay': timedelta(seconds=60)
}

dag = DAG(
    dag_id='nnunet-install-model',
    default_args=args,
    concurrency=1,
    max_active_runs=1,
    schedule_interval=None
)

get_input = LocalGetInputDataOperator(
    dag=dag,
    check_modality=True,
    parallel_downloads=5
)

get_ref_ct_series_from_seg = LocalGetRefSeriesOperator(
    dag=dag,
    input_operator=get_input,
    search_policy="study_uid",
    expected_file_count="all",
    modality="OT",
    parallel_downloads=5,
)

dcm2bin = Bin2DcmOperator(
    dag=dag,
    input_operator=get_ref_ct_series_from_seg,
from kaapana.operators.LocalDeleteFromElasticOperator import LocalDeleteFromElasticOperator
from kaapana.operators.LocalDeleteFromPacsOperator import LocalDeleteFromPacsOperator
from kaapana.operators.LocalGetInputDataOperator import LocalGetInputDataOperator
from kaapana.operators.LocalWorkflowCleanerOperator import LocalWorkflowCleanerOperator

log = LoggingMixin().log

args = {
    'ui_visible': True,
    'owner': 'kaapana',
    'start_date': days_ago(0),
    'retries': 1,
    'retry_delay': timedelta(seconds=30)
}

dag = DAG(dag_id='delete-series-from-platform',
          default_args=args,
          concurrency=30,
          max_active_runs=10,
          schedule_interval=None)

get_input = LocalGetInputDataOperator(dag=dag, data_type="json")
delete_dcm_pacs = LocalDeleteFromPacsOperator(dag=dag,
                                              delete_complete_study=False)
delete_dcm_elastic = LocalDeleteFromElasticOperator(
    dag=dag, delete_complete_study=False)
clean = LocalWorkflowCleanerOperator(dag=dag)

get_input >> delete_dcm_pacs >> delete_dcm_elastic >> clean
Exemplo n.º 4
0
    'ui_visible': True,
    'ui_dag_info': tasks,
    'ui_forms': ui_forms,
    'owner': 'kaapana',
    'start_date': days_ago(0),
    'retries': 0,
    'retry_delay': timedelta(seconds=60)
}

dag = DAG(dag_id='nnunet-predict',
          default_args=args,
          concurrency=50,
          max_active_runs=30,
          schedule_interval=None)

get_input = LocalGetInputDataOperator(dag=dag, check_modality=True)
get_task_model = GetTaskModelOperator(dag=dag)
# get_task_model = GetContainerModelOperator(dag=dag)
dcm2nifti = DcmConverterOperator(dag=dag, output_format='nii.gz')
nnunet_predict = NnUnetOperator(dag=dag,
                                input_dirs=[dcm2nifti.operator_out_dir],
                                input_operator=dcm2nifti)

alg_name = nnunet_predict.image.split("/")[-1].split(":")[0]
nrrd2dcmSeg_multi = Itk2DcmSegOperator(dag=dag,
                                       segmentation_operator=nnunet_predict,
                                       input_type="multi_label_seg",
                                       multi_label_seg_name=alg_name,
                                       alg_name=alg_name)

dcmseg_send_multi = DcmSendOperator(dag=dag, input_operator=nrrd2dcmSeg_multi)
Exemplo n.º 5
0
from kaapana.operators.LocalGetInputDataOperator import LocalGetInputDataOperator
from kaapana.operators.LocalWorkflowCleanerOperator import LocalWorkflowCleanerOperator

log = LoggingMixin().log

args = {
    'ui_visible': False,
    'owner': 'kaapana',
    'start_date': days_ago(0),
    'retries': 2,
    'retry_delay': timedelta(seconds=30),
}

dag = DAG(dag_id='service-extract-metadata',
          default_args=args,
          concurrency=50,
          max_active_runs=50,
          schedule_interval=None)

get_input = LocalGetInputDataOperator(
    dag=dag, operator_out_dir='extract-metadata-input')
extract_metadata = LocalDcm2JsonOperator(dag=dag,
                                         input_operator=get_input,
                                         delete_private_tags=True)
push_json = LocalJson2MetaOperator(dag=dag,
                                   input_operator=get_input,
                                   json_operator=extract_metadata)
clean = LocalWorkflowCleanerOperator(dag=dag, clean_workflow_dir=True)

get_input >> extract_metadata >> push_json >> clean