/usr/lib/python2.7/dist-packages/dipy/tracking/gui_tools.py is in python-dipy 0.10.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 | from warnings import warn
# Import traits as optional package
try:
from traitsui.api import Item, Group, View, ArrayEditor
except ImportError:
from ..utils.optpkg import OptionalImportError
raise OptionalImportError("You must have traits to use this module")
from .interfaces import InputData
from ..tracking.interfaces import InputData, ShmTrackingInterface
I = InputData()
iview = I.trait_view()
iview.resizable = True
iview.width = 600
I.trait_view('traits_view', iview)
main_view = View(Group(Group(
Item( 'dwi_images' ),
Item( 'all_inputs' ),
Item( 'min_signal' ),
Item( 'seed_roi' ),
Item( 'seed_density', editor=ArrayEditor() ),
show_border=True),
Group(
Item( 'smoothing_kernel_type' ),
Item( 'smoothing_kernel' ),
show_border=True),
Group(
Item( 'interpolator' ),
Item( 'model_type' ),
Item( 'sh_order' ),
Item( 'Lambda' ),
Item( 'sphere_coverage' ),
Item( 'min_peak_spacing' ),
Item( 'min_relative_peak' ),
show_border=True),
Group(
Item( 'probabilistic' ),
show_border=True),
Group(
#Item( 'integrator' ),
Item( 'seed_largest_peak', ),
Item( 'track_two_directions' ),
Item( 'start_direction', editor=ArrayEditor(),
enabled_when='not (seed_largest_peak and '
'track_two_directions)'),
Item( 'fa_threshold' ),
Item( 'max_turn_angle' ),
show_border=True),
Group(
Item( 'stop_on_target' ),
Item( 'targets' ),
show_border=True),
Group(
Item( 'save_streamlines_to' ),
Item( 'save_counts_to' ),
show_border=True),
orientation = 'vertical'),
buttons=['OK', 'Cancel'], width=600, close_result=False,
resizable=True, scrollable=True)
def gui_track(interface=None):
if interface is None:
interface = ShmTrackingInterface()
if not interface.configure_traits(view=main_view):
return
if interface.save_streamlines_to == '' and interface.save_counts_to == '':
raise IOError('must provide filename where to save results')
streamlines = interface.track_shm()
if interface.save_streamlines_to and interface.save_counts_to:
streamlines = list(streamlines)
if interface.save_streamlines_to:
interface.save_streamlines(streamlines, interface.save_streamlines_to)
if interface.save_counts_to:
interface.save_counts(streamlines, interface.save_counts_to)
|