pytrip.tripexecuter package

The tripexecuter module provides functions for executing TRiP98 locally or remotely.

class pytrip.tripexecuter.Field(basename='')[source]

Bases: object

One or more Field() object, which then can be added to a Plan() object. :params str basename: basename of field without file extension (input or output will be suffixed with proper file extension)

set_isocenter_from_string(isocenter_str)[source]

Override the automatically determined isocenter from TRiP98. :params str isocenter_str: x,y,z coordinates of the isocenter/target in [mm] in a comma delimted string. such as “123.33,158.4,143.5”. If and empty string is provided, then the isocenter is unset, and TRiP98 will calculate it itself.

Following the target() option in the TRiP98 field command, one can specify the isocenter of the target. If not used, TRiP98 will determine the isocenter from the target Voi provided.

class pytrip.tripexecuter.Execute(ctx, vdx, ctx_path='', vdx_path='')[source]

Bases: object

Execute class for running trip using attached Ctx, Vdx and Plan objects.

add_log_listener(listener)[source]

A listener is something which has a .write(txt) method.

execute(plan, run=True, _callback=None)[source]

Executes the Plan() object using TRiP98.

log(txt)[source]

Writes txt to all listeners, stripping any newlines.

test_local_trip()[source]

Test if TRiP98 can be reached locally. :returns tripname, tripver: Name of TRiP98 installation and its version. :returns: None, None if not installed

test_remote_trip()[source]

Test if TRiP98 can be reached remotely. :returns tripname, tripver: Name of TRiP98 installation and its version. :returns: None, None if not installed

class pytrip.tripexecuter.Plan(basename='', comment='')[source]

Bases: object

Class of handling plans.

clean_voi_caches()[source]

TODO: document me

destroy()[source]

Destructor for Vois and Fields in this class.

load_dose(path, _type, target_dose=0.0)[source]

Load and append a new DOS cube from path to self.doscubes.

load_let(path)[source]

Load and append a new LET cube from path to self.letcubes.

make_exec(no_output=False)[source]

Generates the .exec script from the plan and stores it into self._trip_exec.

make_sis(projectile, focus=(), intensity=(), position=(), path='', write=False)[source]

Creates a SIS table based on path, focus, intensity and position. example: plan.make_sis(“1H”, “4”, “1E6,1E7,1E8”, (2, 20, 0.1)) results in: makesis 1H / focus(4) intensity(1E6,1E7,1E8) position(2 TO 20 BY 0.1)

:params str projectile” such as “12C” or “1H” :params str focus: comma-delimited list of FWHM focus positions in [mm], such as “2,4,6,8” :params str intensities: tuple/list of intensities, such as “1E6,1E7,1E8” :params float position: tuple describing min/max/step range, i.e. (5,40,0.1) for 5 to 40 cm in 1 mm steps. :params path: write path :params write: Set to True, if the generated sis file should be written to path when executed.

save_data(images, path)[source]

Save this plan, including associated data. TODO: may have to be implemented in a better way.

save_exec(exec_path=None)[source]

Generates (overwriting) self._trip_exec, and saves it to exec_path.

save_plan(images, path)[source]

Saves the complete plan to path. 1) *.exec 2) *.dos