Source code for WORC.resources.fastr_tests.segmentix_test
#!/usr/bin/env python# Copyright 2017-2018 Biomedical Imaging Group Rotterdam, Departments of# Medical Informatics and Radiology, Erasmus MC, Rotterdam, The Netherlands## Licensed under the Apache License, Version 2.0 (the "License");# you may not use this file except in compliance with the License.# You may obtain a copy of the License at## http://www.apache.org/licenses/LICENSE-2.0## Unless required by applicable law or agreed to in writing, software# distributed under the License is distributed on an "AS IS" BASIS,# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.# See the License for the specific language governing permissions and# limitations under the License.IS_TEST=True
[docs]defcreate_network():# Import the faster environment and set it upimportfastr# Create a new networknetwork=fastr.Network(id_='Segmentix_test')# Create a source node in the networksource_segmentation=network.create_source('ITKImageFile',id_='segmentation_in')source_mask=network.create_source('ITKImageFile',id_='mask')source_parameters=network.create_source('ParameterFile',id_='parameters')# Create a new node in the network using toollistnode_segmentix=network.create_node('Segmentix',id_="segmentix")# Create a link between the source output and an input of the addint nodenode_segmentix.inputs['segmentation_in']=source_segmentation.outputnode_segmentix.inputs['mask']=source_mask.outputnode_segmentix.inputs['parameters']=source_parameters.output# Create a sink to save the datasink_segmentation=network.create_sink('ITKImageFile',id_='segmentation_out')# Link the addint node to the sinksink_segmentation.input=node_segmentix.outputs['segmentation_out']returnnetwork