====== thinknodeā„¢ Examples ====== These examples provide a starting point for issuing http connections and requests to the dicom app on the thinknodeā„¢ framework. They are provided as is, and are written in python. Any further dependencies are listed along with the provided scripts. ====== Python ====== {{page>dosimetry:userguide:thinknode#python:_Overview&nofooter&noeditbtn}} ===== Python: Calculation Request ===== ==== Posting a Dicom Patient ==== The below example shows how to post a dicom file directory to thinknode iss and return a //rt_study//. Using the //rt_study//, sobp and pbs dose calculations can be performed. See the examples //pbs_dose_calc_from_dicom.py// and //sobp_dose_calc_from_dicom.py// from the [[https://github.com/dotdecimal/astroid-script-library|.decimal GitHub repository]] for more in depth examples of using the dicom app to call dosimetry calculations. # Copyright (c) 2015 .decimal, Inc. All rights reserved. # Date: 09/25/2015 # Desc: Post folder to thinknode and get back a dicom_study import os.path from lib import thinknode_worker as thinknode from lib import dicom_worker as dicom from lib import decimal_logging as dl # Get IAM ids iam = thinknode.authenticate(thinknode.read_config('thinknode.cfg')) # Create a study study_id = dicom.make_rt_study_from_dir(iam, 'E:/dicom/MGH_Phantom_min/') # Combine uploaded CT image slices into an Image_3d datatype study_calc = \ thinknode.function(iam["account_name"], 'dicom', "merge_ct_image_slices", [ thinknode.reference(study_id) ]) study_res = thinknode.do_calculation(iam, study_calc, False) dl.data("Patient rt_tudy ISS ID: " + study_res) ===== Python: decimal Libraries ===== {{page>dosimetry:userguide:thinknode#rt_types&nofooter&noeditbtn}} {{page>dosimetry:userguide:thinknode#thinknode_worker&nofooter&noeditbtn}} ==== dicom_worker ==== The dicom_worker module provides simplified function and calculation requests for common dicom tasks. This library is constantly growing as more routine tasks are programmed in python. Refer to the [[https://github.com/dotdecimal/astroid-script-library|.decimal GitHub repository]] for the complete module. Some basic examples of provided functionality are: - Reading and posting dicom file sets or individual files - Make a dicom study or patient from local files or thinknode data - Pull out dicom data from thinknode data {{page>dosimetry:userguide:thinknode#vtk_worker&nofooter&noeditbtn&noindent}} {{page>dosimetry:userguide:thinknode#decimal_logging&nofooter&noeditbtn&noindent}}