code stringlengths 1 1.72M | language stringclasses 1
value |
|---|---|
# -*- coding: utf-8 -*-
"""
jinja2.ext
~~~~~~~~~~
Jinja extensions allow to add custom tags similar to the way django custom
tags work. By default two example extensions exist: an i18n and a cache
extension.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD.
"""
from collections impor... | Python |
# -*- coding: utf-8 -*-
"""
jinja2.visitor
~~~~~~~~~~~~~~
This module implements a visitor for the nodes.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD.
"""
from jinja2.nodes import Node
class NodeVisitor(object):
"""Walks the abstract syntax tree and call visitor functions for every... | Python |
# -*- coding: utf-8 -*-
"""
jinja2.parser
~~~~~~~~~~~~~
Implements the template parser.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
from jinja2 import nodes
from jinja2.exceptions import TemplateSyntaxError, TemplateAssertionError
from jinja2.utils impo... | Python |
# -*- coding: utf-8 -*-
"""
jinja2.loaders
~~~~~~~~~~~~~~
Jinja loader classes.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import os
import sys
import weakref
from types import ModuleType
from os import path
try:
from hashlib import sha1
except Imp... | Python |
# -*- coding: utf-8 -*-
"""
jinja2.tests
~~~~~~~~~~~~
Jinja test functions. Used with the "is" operator.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import re
from jinja2.runtime import Undefined
# nose, nothing here to test
__test__ = False
number_r... | Python |
# -*- coding: utf-8 -*-
"""
jinja2.filters
~~~~~~~~~~~~~~
Bundled jinja filters.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import re
import math
from random import choice
from operator import itemgetter
from itertools import imap, groupby
from jinja2.... | Python |
import gc
import unittest
from jinja2._markupsafe import Markup, escape, escape_silent
class MarkupTestCase(unittest.TestCase):
def test_markup_operations(self):
# adding two strings should escape the unsafe one
unsafe = '<script type="application/x-some-script">alert("foo");</script>'
sa... | Python |
# -*- coding: utf-8 -*-
"""
jinja2._markupsafe._bundle
~~~~~~~~~~~~~~~~~~~~~~~~~~
This script pulls in markupsafe from a source folder and
bundles it with Jinja2. It does not pull in the speedups
module though.
:copyright: Copyright 2010 by the Jinja team, see AUTHORS.
:license: BSD, see ... | Python |
# -*- coding: utf-8 -*-
"""
markupsafe._native
~~~~~~~~~~~~~~~~~~
Native Python implementation the C module is not compiled.
:copyright: (c) 2010 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from jinja2._markupsafe import Markup
def escape(s):
"""Convert the characters... | Python |
# -*- coding: utf-8 -*-
"""
markupsafe
~~~~~~~~~~
Implements a Markup string.
:copyright: (c) 2010 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import re
from itertools import imap
__all__ = ['Markup', 'soft_unicode', 'escape', 'escape_silent']
_striptags_re = re.compile... | Python |
# -*- coding: utf-8 -*-
"""
markupsafe._constants
~~~~~~~~~~~~~~~~~~~~~
Highlevel implementation of the Markup string.
:copyright: (c) 2010 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
HTML_ENTITIES = {
'AElig': 198,
'Aacute': 193,
'Acirc': 194,
'Agrave': 1... | Python |
# -*- coding: utf-8 -*-
"""
jinja2.exceptions
~~~~~~~~~~~~~~~~~
Jinja exceptions.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
class TemplateError(Exception):
"""Baseclass for all template errors."""
def __init__(self, message=None):
i... | Python |
# -*- coding: utf-8 -*-
"""
jinja2.sandbox
~~~~~~~~~~~~~~
Adds a sandbox layer to Jinja as it was the default behavior in the old
Jinja 1 releases. This sandbox is slightly different from Jinja 1 as the
default behavior is easier to use.
The behavior can be changed by subclassing the environm... | Python |
# -*- coding: utf-8 -*-
"""
jinja2.meta
~~~~~~~~~~~
This module implements various functions that exposes information about
templates that might be interesting for various kinds of applications.
:copyright: (c) 2010 by the Jinja Team, see AUTHORS for more details.
:license: BSD, see LICENSE fo... | Python |
# -*- coding: utf-8 -*-
"""
jinja2.defaults
~~~~~~~~~~~~~~~
Jinja default filters and tags.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
from jinja2.utils import generate_lorem_ipsum, Cycler, Joiner
from gettext import gettext as _ ##ADDD
# defaults for... | Python |
# -*- coding: utf-8 -*-
"""
jinja2._stringdefs
~~~~~~~~~~~~~~~~~~
Strings of all Unicode characters of a certain category.
Used for matching in Unicode-aware languages. Run to regenerate.
Inspired by chartypes_create.py from the MoinMoin project, original
implementation from Pygments.
:co... | Python |
# -*- coding: utf-8 -*-
"""
jinja.constants
~~~~~~~~~~~~~~~
Various constants.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
#: list of lorem ipsum words used by the lipsum() helper function
LOREM_IPSUM_WORDS = u'''\
a ac accumsan ad adipiscing aenean a... | Python |
# -*- coding: utf-8 -*-
"""
jinja2
~~~~~~
Jinja2 is a template engine written in pure Python. It provides a
Django inspired non-XML syntax but supports inline expressions and
an optional sandboxed environment.
Nutshell
--------
Here a small example of a Jinja2 template::
{% ... | Python |
# -*- coding: utf-8 -*-
"""
jinja2.lexer
~~~~~~~~~~~~
This module implements a Jinja / Python combination lexer. The
`Lexer` class provided by this module is used to do some preprocessing
for Jinja.
On the one hand it filters out invalid operators like the bitshift
operators we don't allow... | Python |
# -*- coding: utf-8 -*-
"""
jinja2.environment
~~~~~~~~~~~~~~~~~~
Provides a class that holds runtime and parsing time options.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import os
import sys
from jinja2 import nodes
from jinja2.defaults import *
from ... | Python |
# -*- coding: utf-8 -*-
"""
jinja2.bccache
~~~~~~~~~~~~~~
This module implements the bytecode cache system Jinja is optionally
using. This is useful if you have very complex template situations and
the compiliation of all those templates slow down your application too
much.
Situations whe... | Python |
#!/usr/bin/python
# -*- coding: utf-8 -*-
##
# (C) Copyright 2011 Jose Blanco <jose.blanco[a]vikuit.com>
#
# This file is part of "vikuit".
#
# "vikuit" is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation... | Python |
"""
Copyright (c) 2008, appengine-utilities project
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this
list of conditions and ... | Python |
"""
Copyright (c) 2008, appengine-utilities project
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this
list of conditions and ... | Python |
#!/usr/bin/python
# -*- coding: utf-8 -*-
##
# (C) Copyright 2011 Jose Blanco <jose.blanco[a]vikuit.com>
#
# This file is part of "vikuit".
#
# "vikuit" is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation... | Python |
"""
Copyright (c) 2008, appengine-utilities project
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this
list of conditions and ... | Python |
"""
Copyright (c) 2008, appengine-utilities project
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this
list of conditions and ... | Python |
#!/usr/bin/python
# -*- coding: utf-8 -*-
##
# (C) Copyright 2011 Jose Blanco <jose.blanco[a]vikuit.com>
#
# This file is part of "vikuit".
#
# "vikuit" is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation... | Python |
#!/usr/bin/env python
version = "1.7"
version_info = (1,7,0,"rc-2")
__revision__ = "$Rev: 72 $"
"""
Python-Markdown
===============
Converts Markdown to HTML. Basic usage as a module:
import markdown
md = Markdown()
html = md.convert(your_text_string)
See http://www.freewisdom.org/projects/python-mark... | Python |
#!/usr/bin/python
# -*- coding: utf-8 -*-
##
# (C) Copyright 2011 Jose Blanco <jose.blanco[a]vikuit.com>
#
# This file is part of "vikuit".
#
# "vikuit" is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software ... | Python |
#!/usr/bin/env python
import struct
from StringIO import StringIO
from google.appengine.api import images
def resize(image, maxwidth, maxheight):
imageinfo = getimageinfo(image)
width = float(imageinfo[1])
height = float(imageinfo[2])
ratio = width / height
dwidth = maxheight * ratio
dheight = ma... | Python |
import simplejson
import cgi
class JSONFilter(object):
def __init__(self, app, mime_type='text/x-json'):
self.app = app
self.mime_type = mime_type
def __call__(self, environ, start_response):
# Read JSON POST input to jsonfilter.json if matching mime type
response = {... | Python |
"""
Implementation of JSONDecoder
"""
import re
import sys
from simplejson.scanner import Scanner, pattern
try:
from simplejson import _speedups
except:
_speedups = None
FLAGS = re.VERBOSE | re.MULTILINE | re.DOTALL
def _floatconstants():
import struct
import sys
_BYTES = '7FF800... | Python |
"""
Iterator based sre token scanner
"""
import sre_parse, sre_compile, sre_constants
from sre_constants import BRANCH, SUBPATTERN
from re import VERBOSE, MULTILINE, DOTALL
import re
__all__ = ['Scanner', 'pattern']
FLAGS = (VERBOSE | MULTILINE | DOTALL)
class Scanner(object):
def __init__(self, lexic... | Python |
"""
Implementation of JSONEncoder
"""
import re
try:
from simplejson import _speedups
except ImportError:
_speedups = None
ESCAPE = re.compile(r'[\x00-\x1f\\"\b\f\n\r\t]')
ESCAPE_ASCII = re.compile(r'([\\"/]|[^\ -~])')
ESCAPE_DCT = {
'\\': '\\\\',
'"': '\\"',
'\b': '\\b',
'\f': '... | Python |
r"""
A simple, fast, extensible JSON encoder and decoder
JSON (JavaScript Object Notation) <http://json.org> is a subset of
JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data
interchange format.
simplejson exposes an API familiar to uses of the standard library
marshal and pickle modules.
... | Python |
#!/usr/bin/python
# -*- coding: utf-8 -*-
##
# (C) Copyright 2011 Jose Blanco <jose.blanco[a]vikuit.com>
# (C) Copyright 2011 Jose Carrasco <jose.carrasco[a]vikuit.com>
#
# This file is part of "vikuit".
#
# "vikuit" is free software: you can redistribute it and/or modify
# it under the terms of the GNU Aff... | Python |
import copy
from logging_mixin import LoggingMixin
import os
from simple_api_mixin import SimpleAPIMixin
class ScriptInterface(SimpleAPIMixin, LoggingMixin):
def __init__(self, devide_app):
self.devide_app = devide_app
# initialise logging mixin
LoggingMixin.__init__(self)
print ... | Python |
# simple api mixin to be used by RPC and command line interfaces
# of DeVIDE that require simple methods for speaking to a running
# instance
class SimpleAPIMixin:
def __init__(self, devide_app):
self.devide_app = devide_app
def close(self):
del self.devide_app
def load_and_realise_netwo... | Python |
# logging mixin for use by DeVIDE interfaces
import logging
import sys
class LoggingMixin:
def __init__(self):
# this sets things up for logging to stderr
logging.basicConfig(level=logging.DEBUG,
format='%(asctime)s %(levelname)s %(message)s',
... | Python |
from logging_mixin import LoggingMixin
from SimpleXMLRPCServer import SimpleXMLRPCServer
import time
class ServerProxy:
def test_function(self):
return "Hello World!"
class XMLRPCInterface(LoggingMixin):
def __init__(self, devide_app):
self._devide_app = devide_app
# initialise loggi... | Python |
# required for this dir to be recognised as package.
| Python |
# Copyright (c) Charl P. Botha, TU Delft
# All rights reserved.
# See COPYRIGHT for details.
# we use psutil for keeping an eye on memory (and crashes)
# if you don't have this yet, install with:
# dre shell
# pip install psutil
import psutil
import string
import sys
import time
import webbrowser
import wx
import wx.... | Python |
# Copyright (c) Charl P. Botha, TU Delft
# All rights reserved.
# See COPYRIGHT for details.
# FIXME: def show() should really be moved a level up!!
# left click on glyph: select and drag
# left click on canvas: rubberband select
# right click on glyph: glyph context menu
# right click on canvas: canvas context menu
... | Python |
# Copyright (c) Charl P. Botha, TU Delft
# All rights reserved.
# See COPYRIGHT for details.
import vtk
from vtk.wx.wxVTKRenderWindowInteractor import wxVTKRenderWindowInteractor
import wx
from module_kits.wx_kit import utils as wxutils
import wx.lib.agw.aui as aui
wx.aui = aui
from wx.html import HtmlWindow
class ... | Python |
from main import WXInterface
| Python |
import Pyro.core
import time
# client example:
# import Pyro.core
# Pyro.core.initClient()
# URI = 'PYROLOC://localhost:7766/DeVIDE'
# p = Pyro.core.getProxyForURI(URI)
# p.test_func()
class ServerProxy(Pyro.core.ObjBase):
def test_function(self):
return "Hello world!"
class PyroInterface:
def __ini... | Python |
# Copyright (c) Charl P. Botha, TU Delft.
# All rights reserved.
# See COPYRIGHT for details.
"""Collection of module utility functions.
@author: Charl P. Botha <http://cpbotha.net/>
"""
import wx
import resources.graphics.images
def create_eoca_buttons(d3module, viewFrame, viewFramePanel,
o... | Python |
# python rules. severely.
# (c) 2007 cpbotha
import glob
import sys
import os
import shutil
import zipfile
def main():
cwd = os.path.abspath(os.curdir)
hhp_dir = os.path.join(cwd, 'devidehelp_tmphhp')
os.chdir(hhp_dir)
htb_list = glob.glob('*.html') + \
glob.glob('*.png') + \
glob.... | Python |
# Copyright (c) Charl P. Botha, TU Delft.
# All rights reserved.
# See COPYRIGHT for details.
from external.vtkPipeline.ConfigVtkObj import ConfigVtkObj
from external.vtkPipeline.vtkMethodParser import VtkMethodParser
from external.vtkPipeline.vtkPipeline import vtkPipelineBrowser
import gen_utils
from module_base imp... | Python |
# Copyright (c) Charl P. Botha, TU Delft
# All rights reserved.
# See COPYRIGHT for details.
from module_base import ModuleBase
from module_mixins import ScriptedConfigModuleMixin
import module_utils
import vtk
import math
class MarschnerLobb(ScriptedConfigModuleMixin, ModuleBase):
def __init__(self, module_mana... | Python |
import gen_utils
from module_base import ModuleBase
import module_utils
import module_mixins
from module_mixins import ScriptedConfigModuleMixin
import os
import vtk
class cptDistanceField(ScriptedConfigModuleMixin, ModuleBase):
def __init__(self, module_manager):
# call parent constructor
Module... | Python |
# pointsToSpheres.py copyright (c) 2005 by Charl P. Botha <cpbotha@ieee.org>
# $Id$
# see module documentation
import gen_utils
from module_base import ModuleBase
from module_mixins import ScriptedConfigModuleMixin
import module_utils
import wx
import vtk
class pointsToSpheres(ScriptedConfigModuleMixin, ModuleBase):
... | Python |
# $Id$
from module_base import ModuleBase
from module_mixins import ScriptedConfigModuleMixin
import module_utils
import vtk
class superQuadric(ScriptedConfigModuleMixin, ModuleBase):
def __init__(self, module_manager):
ModuleBase.__init__(self, module_manager)
# setup config
self._confi... | Python |
#
#
#
from module_base import ModuleBase
from module_mixins import ScriptedConfigModuleMixin
import module_utils
import operator
import vtk
import wx
class advectionProperties(ScriptedConfigModuleMixin, ModuleBase):
_numberOfInputs = 16
def __init__(self, module_manager):
ModuleBase.__init__(self, mo... | Python |
from module_base import ModuleBase
from module_mixins import ScriptedConfigModuleMixin
import module_utils
import vtk
class manualTransform(ScriptedConfigModuleMixin, ModuleBase):
def __init__(self, module_manager):
ModuleBase.__init__(self, module_manager)
self._config.scale = (1.0, 1.0, 1.0)
... | Python |
# $Id$
class advectionProperties:
kits = ['vtk_kit']
cats = ['Sources']
help = """Given a series of prepared advection volumes (each input is a
timestep), calculate a number of metrics.
The first input HAS to have a VolumeIndex PointData attribute/array. For
example, the output of the pointsT... | Python |
from module_base import ModuleBase
from module_mixins import NoConfigModuleMixin
import module_utils
class PassThrough(NoConfigModuleMixin, ModuleBase):
def __init__(self, module_manager):
# initialise our base class
ModuleBase.__init__(self, module_manager)
NoConfigModuleMixin.__init__(
... | Python |
# dumy __init__ so this directory can function as a package
| Python |
# $Id$
from module_base import ModuleBase
from module_mixins import ScriptedConfigModuleMixin
import module_utils
import vtk
class implicitToVolume(ScriptedConfigModuleMixin, ModuleBase):
def __init__(self, module_manager):
ModuleBase.__init__(self, module_manager)
# setup config
self._c... | Python |
from module_base import ModuleBase
from module_mixins import IntrospectModuleMixin
import module_utils
import vtk
import vtkdevide
import wx
class histogramSegment(IntrospectModuleMixin, ModuleBase):
"""Mooooo! I'm a cow.
$Revision: 1.9 $
"""
_gridCols = [('Type', 0), ('Number of Handles',0)]
_g... | Python |
from external import wxPyPlot
import gen_utils
from module_base import ModuleBase
from module_mixins import IntrospectModuleMixin
import module_utils
try:
import Numeric
except:
import numarray as Numeric
import vtk
import wx
class histogram1D(IntrospectModuleMixin, ModuleBase):
"""Calculates and sh... | Python |
# Copyright (c) Charl P. Botha, TU Delft.
# All rights reserved.
# See COPYRIGHT for details.
import cStringIO
from vtk.wx.wxVTKRenderWindowInteractor import wxVTKRenderWindowInteractor
import wx
# wxPython 2.8.8.1 wx.aui bugs severely on GTK. See:
# http://trac.wxwidgets.org/ticket/9716
# Until this is fixed, use th... | Python |
# Modified by Francois Malan, LUMC / TU Delft
# Copyright (c) Charl P. Botha, TU Delft.
# All rights reserved.
# See COPYRIGHT for details.
from vtk.wx.wxVTKRenderWindowInteractor import wxVTKRenderWindowInteractor
import wx
import wx.lib.inspection
import vtk
# wxPython 2.8.8.1 wx.aui bugs severely on GTK. See:
# ht... | Python |
# $Id$
from module_base import ModuleBase
from module_mixins import ScriptedConfigModuleMixin
import module_utils
import vtk
import vtkdevide
class histogram2D(ScriptedConfigModuleMixin, ModuleBase):
"""This module takes two inputs and creates a 2D histogram with input 2
vs input 1, i.e. input 1 on x-axis and... | Python |
# Copyright (c) Charl P. Botha, TU Delft.
# All rights reserved.
# See COPYRIGHT for details.
# Hello there person reading this source!
# At the moment, I'm trying to get a fully-functioning DICOM browser
# out the door as fast as possible. As soon as the first version is
# out there and my one user can start giving ... | Python |
# Copyright (c) Charl P. Botha, TU Delft.
# All rights reserved.
# See COPYRIGHT for details.
# skeleton of an AUI-based viewer module
# copy and modify for your own purposes.
# set to False for 3D viewer, True for 2D image viewer
IMAGE_VIEWER = True
# import the frame, i.e. the wx window containing everything
impor... | Python |
# check python24/lib/code.py - exceptions raised only result in
# printouts. perhaps we want a real exception?
import code # deep magic
import md5
from module_base import ModuleBase
from module_mixins import IntrospectModuleMixin, WindowRenameMixin
import module_utils
import sys
import module_kits.wx_kit
from module_... | Python |
# Copyright (c) Charl P. Botha, TU Delft.
# All rights reserved.
# See COPYRIGHT for details.
import csv
import geometry
import glob
import os
import math
from module_base import ModuleBase
from module_mixins import IntrospectModuleMixin,\
FileOpenDialogModuleMixin
import module_utils
import vtk
import vtkgdcm... | Python |
# - make our own window control for colour-sequence bar
# - this should also have separate (?) line with HSV colour vertices
# - on this line, there should be vertical lines indicating the current
# position of all the opacity transfer function vertices
# - abstract floatcanvas-derived linear function editor into wx_... | Python |
from module_kits.misc_kit.mixins import SubjectMixin
import geometry
from module_base import ModuleBase
from module_mixins import IntrospectModuleMixin
import module_utils
import Measure2DFrame
reload(Measure2DFrame)
import vtk
import vtktudoss
import wx
class M2DMeasurementInfo:
pass
class M2DWidget:
"""Cla... | Python |
# Copyright (c) Charl P. Botha, TU Delft.
# All rights reserved.
# See COPYRIGHT for details.
import comedi_utils
reload(comedi_utils)
import vtk
import vtktudoss
from module_kits import vtk_kit
import wx
###########################################################################
# 2D:
# * Checkerboard.
# * differe... | Python |
import vtk
import wx
from vtk.wx.wxVTKRenderWindowInteractor import wxVTKRenderWindowInteractor
import external.PyAUI as PyAUI
from resources.python import measure2d_panels
reload(measure2d_panels)
class Measure2DFrame(wx.Frame):
def __init__(self, parent, id=-1, title="", pos=wx.DefaultPosition,
... | Python |
from wxPython._controls import wxLIST_MASK_STATE
from wxPython._controls import wxLIST_STATE_SELECTED
import os.path
# Modified by Francois Malan, LUMC / TU Delft
# December 2009
#
# based on the SkeletonAUIViewer:
# skeleton of an AUI-based viewer module
# Copyright (c) Charl P. Botha, TU Delft.
# set to False for 3D... | Python |
from module_base import ModuleBase
from module_mixins import IntrospectModuleMixin
import module_utils
import operator
HTML_START = '<html><body>'
HTML_END = '</body></html>'
def render_actions(lines):
ms = '<p><b><ul>%s</ul></b></p>'
# this should yield: <li>thing 1\n<li>thing 2\n<li>thing 3 etc
bullets ... | Python |
# Copyright (c) Charl P. Botha, TU Delft.
# All rights reserved.
# See COPYRIGHT for details.
from external.ObjectListView import ColumnDefn, EVT_CELL_EDIT_FINISHING
import itk
from module_kits import itk_kit
import module_utils
import vtk
import wx
####################################################################... | Python |
# Copyright (c) Charl P. Botha, TU Delft.
# All rights reserved.
# See COPYRIGHT for details.
class CodeRunner:
kits = ['wx_kit', 'vtk_kit']
cats = ['Viewers']
help = \
"""CodeRunner facilitates the direct integration of Python code into a
DeVIDE network.
The top part contains three editor int... | Python |
#Hacked out of a class contained in Charl Botha's comedi_utils.py
#Incorporated edits by by Corine Slagboom & Noeska Smit which formed part of their comedi_utils module, used in their 'Emphysema Viewer'
#Final version by Francois Malan (2010-2011)
from module_kits.vtk_kit.utils import DVOrientationWidget
import o... | Python |
# Copyright (c) Charl P. Botha, TU Delft.
# All rights reserved.
# See COPYRIGHT for details.
# skeleton of an AUI-based viewer module
# copy and modify for your own purposes.
# set to False for 3D viewer, True for 2D image viewer
IMAGE_VIEWER = True
MATCH_MODE_PASSTHROUGH = 0
MATCH_MODE_LANDMARK_SS = 1
MATCH_MODE_... | Python |
# sliceDirections.py copyright (c) 2003 Charl P. Botha <cpbotha@ieee.org>
# $Id$
# class encapsulating all instances of the sliceDirection class
import gen_utils
# the following two lines are only needed during prototyping of the modules
# that they import
import modules.viewers.slice3dVWRmodules.sliceDirection
reloa... | Python |
# shared.py copyright (c) 2003 Charl P. Botha <cpbotha@ieee.org>
# $Id$
#
import wx
class s3dcGridMixin(object):
"""
"""
def _handlerGridRangeSelect(self, event):
"""This event handler is a fix for the fact that the row
selection in the wxGrid is deliberately broken. It's also
... | Python |
# tdObjects.py copyright (c) 2003 by Charl P. Botha <cpbotha@ieee.org>
# $Id$
# class that controls the 3-D objects list
import gen_utils
reload(gen_utils)
import math
import module_kits
from module_kits.vtk_kit import misc
from modules.viewers.slice3dVWRmodules.shared import s3dcGridMixin
import operator
import vtk
i... | Python |
# Copyright (c) Charl P. Botha, TU Delft
# All rights reserved.
# See COPYRIGHT for details.
import operator
import module_utils
import vtk
import wx
class sliceDirection:
"""Class encapsulating all logic behind a single direction.
This class contains the IPWs and related paraphernalia for all layers
(pr... | Python |
# selectedPoints.py copyright (c) 2003 Charl P. Botha <cpbotha@ieee.org>
# $Id$
#
from module_kits.misc_kit.mixins import SubjectMixin
from modules.viewers.slice3dVWRmodules.shared import s3dcGridMixin
import operator
import vtk
import wx
# -------------------------------------------------------------------------
c... | Python |
# implicits.py copyright (c) 2003 Charl P. Botha <cpbotha@ieee.org>
# $Id$
import gen_utils
from modules.viewers.slice3dVWRmodules.shared import s3dcGridMixin
import vtk
import wx
# -------------------------------------------------------------------------
class implicitInfo:
def __init__(self):
self.name... | Python |
# dumy __init__ so this directory can function as a package
| Python |
# dumy __init__ so this directory can function as a package
| Python |
# dumy __init__ so this directory can function as a package
| Python |
# Copyright (c) Charl P. Botha, TU Delft.
# All rights reserved.
# See COPYRIGHT for details.
import cStringIO
import vtk
from vtk.wx.wxVTKRenderWindowInteractor import wxVTKRenderWindowInteractor
import wx
# wxPython 2.8.8.1 wx.aui bugs severely on GTK. See:
# http://trac.wxwidgets.org/ticket/9716
# Until this is fi... | Python |
# Copyright (c) Charl P. Botha, TU Delft.
# All rights reserved.
# See COPYRIGHT for details.
import cStringIO
from vtk.wx.wxVTKRenderWindowInteractor import wxVTKRenderWindowInteractor
import wx
# wxPython 2.8.8.1 wx.aui bugs severely on GTK. See:
# http://trac.wxwidgets.org/ticket/9716
# Until this is fixed, use th... | Python |
# Copyright (c) Charl P. Botha, TU Delft
# All rights reserved.
# See COPYRIGHT for details.
# NOTES:
# you can't put the RWI in a StaticBox, it never manages to appear.
# mode: add / subtract
# tool: new region growing, level set (with existing mask), draw
# closed polygon, delete
# ARGH. region growing results in... | Python |
# slice3d_vwr.py copyright (c) 2002-2010 Charl P. Botha
# next-generation of the slicing and dicing devide module
# TODO: 'refresh' handlers in set_input()
# TODO: front-end / back-end module split (someday)
# should we use background renderer for gradient background, or
# built-in VTK functionality?
BACKGROUND_RENDE... | Python |
# Copyright (c) Charl P. Botha, TU Delft.
# All rights reserved.
# See COPYRIGHT for details.
from module_kits.vtk_kit.utils import DVOrientationWidget
import operator
import vtk
import wx
class SyncSliceViewers:
"""Class to link a number of CMSliceViewer instances w.r.t.
camera.
FIXME: consider adding o... | Python |
# $Id: vtpWRT.py 2401 2006-12-20 20:29:15Z cpbotha $
from module_base import ModuleBase
from module_mixins import FilenameViewModuleMixin
import module_utils
import types
class MatlabPointsWriter(FilenameViewModuleMixin, ModuleBase):
def __init__(self, module_manager):
# call parent constructor
M... | Python |
# $Id$
from module_base import ModuleBase
from module_mixins import FilenameViewModuleMixin
import module_utils
import vtk
class vtpWRT(FilenameViewModuleMixin, ModuleBase):
def __init__(self, module_manager):
# call parent constructor
ModuleBase.__init__(self, module_manager)
self._wri... | Python |
# $Id$
from module_base import ModuleBase
from module_mixins import FilenameViewModuleMixin
import module_utils
import vtk
class vtiWRT(FilenameViewModuleMixin, ModuleBase):
def __init__(self, module_manager):
# call parent constructor
ModuleBase.__init__(self, module_manager)
self._wri... | Python |
# $Id: vtpWRT.py 2401 2006-12-20 20:29:15Z cpbotha $
from module_base import ModuleBase
from module_mixins import FilenameViewModuleMixin
import module_utils
import types
class points_writer(FilenameViewModuleMixin, ModuleBase):
def __init__(self, module_manager):
# call parent constructor
Module... | Python |
# $Id$
from module_base import ModuleBase
from module_mixins import FilenameViewModuleMixin
import module_utils
import vtk
class vtkStructPtsWRT(FilenameViewModuleMixin, ModuleBase):
def __init__(self, module_manager):
# call parent constructor
ModuleBase.__init__(self, module_manager)
... | Python |
# Copyright (c) Charl P. Botha, TU Delft
# All rights reserved.
# See COPYRIGHT for details.
# Random development notes:
# * SetFileDimensionality(2) if you want multiple slices written from
# a single volume
# * just generate im%05d.dcm filenames, as many as there are slices
# * study / series UIDs are auto generat... | Python |
# $Id$
from module_base import ModuleBase
from module_mixins import FilenameViewModuleMixin
import module_utils
import vtk
class vtkPolyDataWRT(FilenameViewModuleMixin, ModuleBase):
def __init__(self, module_manager):
# call parent constructor
ModuleBase.__init__(self, module_manager)
... | Python |
Subsets and Splits
SQL Console for ajibawa-2023/Python-Code-Large
Provides a useful breakdown of language distribution in the training data, showing which languages have the most samples and helping identify potential imbalances across different language groups.