code stringlengths 1 1.72M | language stringclasses 1
value |
|---|---|
# Create your views here.
| Python |
# -*- coding:utf-8 -*-
import wolfox.lib.codeblock import function2block
import wolfox.foxit.utils.vdict as vdict
CTYPE = {'ONE':1,'ALL':2,'CATALOG':2} #normal为与具体stock数据无关的计算
CALCED,GLOBAL,ALL,ALLCATALOG = 'CACLED','GLOBAL','ALL','ALLCATALOG'
class Context(object):
''' Task内部context组织
... | Python |
# -*- coding:utf-8 -*-
#depreated 已经被废弃
import unittest
import numpy
from wolfox.foxit.dune.dyn_service import *
from wolfox.foxit.dune.models import XDayQuote
from wolfox.foxit.dune.test_common import prepare,clean
class DynDataTest(unittest.TestCase):
def setUp(self):
prepare()
... | Python |
# -*- coding: utf-8 -*-
''' 基本的批量数据操作
SqlStore: 基本上以纯sql实现
NormalStore: 以Django Orm实现
这里有两个问题:
1. sqlite的事务独占访问问题. 当django/sql事务未完成时,sqlite文件不能以写模式再次打开
2. 如果SqlStore的Conn不是从Django得到的,而是直接针对db文件打开。则可能一个较大跨度中的操作不是在同一个连接中,
也相当于在两个互相隔离的事务里,这些操作的相互直接的逻辑影响无法得到(比如先同步code在导... | Python |
from django.conf.urls.defaults import *
urlpatterns = patterns('',
# Example:
# (r'^foxit/', include('foxit.foo.urls')),
# Uncomment this for admin:
(r'^admin/', include('django.contrib.admin.urls')),
)
| Python |
# -*- coding:utf-8 -*-
#本package用于技术和应用上的试验
| Python |
# -*- coding:utf-8 -*-
from decorator import decorator
| Python |
# -*- coding: utf-8 -*-
import unittest
import os.path
from wolfox.foxit.base.tutils import *
class ModuleTest(unittest.TestCase):
def testTempFile(self): #测试mktemp,removetemp
fo = mktemp('test code')
self.assertEquals('test code',open(fo['name']).read())
removetemp(fo)
... | Python |
# -*-coding:utf-8 -*-
VOLUME_BASE = 100L; #手
AMOUNT_BASE = 100000L; #百元 = 10000分 = 100000厘
class asdict(object):
def __getitem__(self,key): #允许dict的调用方法
#print "getitem:" + key
if(self.has_key(key)):
return getattr(self,key)
def has_key(self,key):
return ke... | Python |
# -*- coding: utf-8 -*-
#This project is licensed under the Apache License Version 2.0
#author: wycharon@gmail.com
#一些工具类和函数
import os
import sys,codecs
import logging,logging.handlers
LINELENGTH = 60
iseq = range(9999) #用于在list迭代中得到下标,如 [i for i,v in zip(iseq,sourcelist)] 将得到一个index列表
#两个临时文件的帮助函... | Python |
# -*- coding: utf-8 -*-
"""
本文件用于验证fxj数据解码的正确性
"""
import unittest
from wolfox.foxit.base.common import Quote
from wolfox.foxit.source import reader,filestore,fxj
import os.path
cur_dir = os.path.dirname(__file__)
#test_dir = os.path.split(cur_dir)[0]
#test_data_dir = os.path.join(test_dir,'data')
... | Python |
# -*- coding: utf-8 -*-
import logging
import time
#from django.db import transaction
import wolfox.foxit.source.reader as reader
from wolfox.foxit.base.tutils import linelog
from wolfox.foxit.dune.models import PowerInfo,Exchange,StockType,Catalog
logger = logging.getLogger("source.transfer")
class Tra... | Python |
# -*- coding: utf-8 -*-
#检查上证指数和深证指数的一致性,输出不一致的日期
not_in_sh ='''
select tdate from dune_xdayquote dx
join dune_stockcode ds on ds.id = dx.tstock_id
where code = 'SZ399001' and tdate > 19960101 and tdate not in (select tdate from
dune_xdayquote dx
join dune_stockcode ds on ds.id = dx.tstock_id
where code ... | Python |
# -*- coding: utf-8 -*-
"""
本文件用于验证fxj数据解码的正确性
"""
import unittest
class CommonTest(unittest.TestCase):
def testModule(self):
from wolfox.foxit.source.common import patterns,pattern1,pattern2
self.assertTrue(True)
if __name__ == "__main__":
import logging
logging.bas... | Python |
# -*- coding: utf-8 -*-
from wolfox.source.fxj import DayExtractor,XExtractor,ReportExtractor
from wolfox.source.transfer import createFilter
import wolfox.source.reader as reader
def get_day_info(filename,extractor,begin=0,end=99999999,stocks=None):
''' 获得指定文件在指定时间段内的记录数'''
ri = reader.Reader(ext... | Python |
# -*- coding: utf-8 -*-
import logging
from wolfox.foxit.base.tutils import parseName
logger = logging.getLogger("foxit.source.reader")
class NullFilter(object):
def filter(self,record):
return True
nullFilter = NullFilter()
class DateFilter(object): #只能做filter链条末端的filter,不设置innerFilter
... | Python |
# -*- coding: utf-8 -*-
''' 分析家数据格式相关类的聚集
这些类的数据读取方法,在返回值中存在股票代码时,必须已经转换为标准代码
'''
import logging
import re
import glob
import os.path
from datetime import datetime
from struct import unpack
from wolfox.foxit.base.common import Quote,createQuoteFromSrc,createXInfoFromSrc,createReportFromSrc
impo... | Python |
# -*- coding: utf-8 -*-
import unittest
from wolfox.foxit.source.filestore import CSVStore
TEST_FILE = 'fstest.txt'
class CSVStoreTest(unittest.TestCase):
def tearDown(self):
try:
import os
os.remove(TEST_FILE)
except Exception: #init测试中这个文件未创建
pass... | Python |
# -*- coding: utf-8 -*-
import unittest
from wolfox.foxit.source.check import check
class CheckTest(unittest.TestCase):
#只测试通路
def test_throught(self):
from django.core.management import setup_environ
import wolfox.foxit.settings as settings
setup_environ(settings)
... | Python |
# -*- coding: utf-8 -*-
''' transfer模块的测试类
测试原则:逐步编织和完善测试网, 拒绝一步到位,也拒绝同样错误再次漏过.
验证主功能走通并正确
对于边界情况和异常流程,在发生错误时定位捕获. 初步时可只针对重要情况做事先测试,也可不做。
'''
from unittest import TestCase
from wolfox.foxit.lib.mock import Mock,patch,sentinel
from wolfox.foxit.dune.test_common import prepare,clean
... | Python |
# -*- coding: utf-8 -*-
''' 格式的公共部分
'''
import re
patterns = [(re.compile('SH000...|SZ399...'),u'指数'),
(re.compile('SH18....|SH5000..|SH500180|SH510...|SH000300|SZ18....|SZ159...'),u'基金'),
(re.compile('SH600...|SH601...|SZ000...|SZ002...|SZ300'),u'股票'),
(re.compile('SH... | Python |
# -*- coding: utf-8 -*-
from django.db import models
class Normal(models.Model):
name = models.CharField(max_length=16)
i1 = models.IntegerField()
i2 = models.IntegerField()
i3 = models.IntegerField()
i4 = models.IntegerField()
i5 = models.IntegerField()
i6 = models.IntegerField... | Python |
# -*- coding: utf-8 -*-
#测试一维序和二维序的寻址速度
#基本持平(包括transpose的),相差大概最多只有5%
#但是如果是针对特殊的行/列作运算,速度下降极快,至少有2个数量级
# 发现问题主要出在 sum(a)与a.sum()的差距上,这个有数量级的差别。估计类似的差别在别的函数上也会有体现
# 这个是我的原因,居然直接用了python的sum,而不是np.sum,倒!!!!!!!
# 去除这个因素,则性能损失大概在50%左右
#因此,在计算之前将数据整理好还是有效果的
import numpy as np
from time import time
... | Python |
# -*- coding: utf-8 -*-
#比较两种方式在读取数据上的效率
#方式1:普通成批读取,然后用sync同步成等长序列
#方式2:逐个读取,获得的直接就是等长序列. 发现onebyone比成批速度快1.5倍
#经过分析,发现性能瓶颈主要在于organize_tuples2quotes这个函数,因为数据没有按照stock,date排序,所以分派非常耗时
#优化之后,效率相差不多,但还是onebyone快%15左右
from time import time
from django.core.management import setup_environ
import wolfox.foxit.s... | Python |
# -*- coding: utf-8 -*-
'''比较三种方式的插入效率
方式1: 纯粹django
方式2a: django中直接使用sql,使用占位符号
方法2b: 直接使用填完后的字符串
方式3: 纯粹sql
都插入100000条记录
测试结果:
1. 82.5789999962 81.625
2. 27.0780000687 27.2649998665
3. 29.7339999676 29.6880002022
4. 6.59400010109 6.31200003624
... | Python |
# -*- coding: utf-8 -*-
'''比较两种方式的select效率
首先需要执行insert.py,插入大约200000条记录
然后比较django objects.filter()和sql同时选出2000条记录的效率
mixed: 使用django的connection来完成纯粹的sql工作,函数与sselect基本相同,
但传入的connection不同,同时参数的传递风格(paramstyle)不同,django用%s, sqlite用?方式
mixed2: 使用sql connection,但返回的数据转化为django的对象
... | Python |
# Create your views here.
| Python |
# -*- coding:utf-8 -*-
class vdict(dict):
''' 键值属性化的dict '''
def __getattribute__(self,att_name):
if att_name in self:
return self[att_name]
return dict.__getattribute__(self,att_name)
| Python |
# mock.py
# Test tools for mocking and patching.
# Copyright (C) 2007 Michael Foord
# E-mail: fuzzyman AT voidspace DOT org DOT uk
# mock 0.3.1
# http://www.voidspace.org.uk/python/mock.html
# Released subject to the BSD License
# Please see http://www.voidspace.org.uk/python/license.shtml
# Scripts maint... | Python |
#!/usr/bin/env python
from django.core.management import execute_manager
try:
import settings # Assumed to be in the same directory.
except ImportError:
import sys
sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll ha... | Python |
# The default ``config.py``
def set_prefs(prefs):
"""This function is called before opening the project"""
# Specify which files and folders to ignore in the project.
# Changes to ignored resources are not added to the history and
# VCSs. Also they are not returned in `Project.get_files()`.
# No... | Python |
import deck
import 14utils
import 14
numPlayers = 0
numDecks = ''
players = []
cardDeck = deck.Deck()
def main():
try:
numPlayers = int(input("Number of Players (2-4): "))
if not 14utils.restrictInput(numPlayers, 2, 4):
raise ValueError
e... | Python |
import random
class Deck:
def __init__(self):
self.cards = []
self.generateDeck()
def generateDeck(self, decks=1):
for iii in range(decks):
for i in range(4):
for ii in range(9):
self.cards.append( (self.cardSuit(i), str(2+ii... | Python |
def restrictInput(_input, _low, _high):
if(_input<_low or _input >_high):
# print("Invalid Input")
return False
return True
| Python |
import kohutils
class Player():
def __init__(self):
self.faceDownCards = []
self.faceUpCards = []
self.hand = []
def playCard(self, pileCards, indexHand, indexCard):
# Plays a card.
# indexHand: 0 = hand, 1 = cards on field
# indexCard = which card
... | Python |
#!/usr/bin/env python
import string
"""
Define functions that serve to decode strings in a sample of backdoor.android.obad.a (F7BE25E4F19A3A82D2E206DE8AC979C8)
"""
main_service_tab = [
27, -9, 11, -41, -10, -2, 2, -7,
23, -19, -49, 73, 1, -9, 5, -60, 32, 37, -10, 0, 13, -5, 26, -21,
6, -28, 10, -18, 2, 15, -... | Python |
#!/usr/bin/env python
"""
Personal notes
Goal : cluster Android apk that are similar according to the similarity features introduced in Androguard
"""
| 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 |
# 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 |
# required for this dir to be recognised as package.
| 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 |
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.
# 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 |
from main import WXInterface
| 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 |
# Copyright (c) Charl P. Botha, TU Delft.
# All rights reserved.
# See COPYRIGHT for details.
###################################################################
# the following programmes should either be on your path, or you
# should specify the full paths here.
# Microsoft utility to rebase files.
REBASE = "rebase... | Python |
# Copyright (c) Charl P. Botha, TU Delft.
# All rights reserved.
# See COPYRIGHT for details.
# RESTRUCTURE:
# * remove_binaries (startswith and contains)
# * remove_pure (startswith and contains)
# NB: stay away from any absolute path dependencies!!!
import os
import fnmatch
import re
import sys
def helper_remov... | Python |
"""Module for independently packaging up whole WrapITK tree.
"""
import itkConfig
import glob
import os
import shutil
import sys
# customise the following variables
if os.name == 'nt':
SO_EXT = 'dll'
SO_GLOB = '*.%s' % (SO_EXT,)
PYE_GLOB = '*.pyd'
# this should be c:/opt/ITK/bin
ITK_SO_DIR = os.p... | Python |
# miscellaneous imports used by snippets
hiddenimports = ['tempfile']
| Python |
hiddenimports = ['matplotlib.numerix',
'matplotlib.numerix.fft',
'matplotlib.numerix.linear_algebra',
'matplotlib.numerix.ma',
'matplotlib.numerix.mlab',
'matplotlib.numerix.npyma',
'matplotlib.numerix.random_array',
'matplotlib.backends.backend_wxagg']
print "[... | Python |
# so vtktudoss.py uses a list of names to construct the various imports
# at runtime, installer doesn't see this. :(
import os
if os.name == 'posix':
hiddenimports = [
'libvtktudossGraphicsPython',
'libvtktudossWidgetsPython',
'libvtktudossSTLibPython']
else:
hiddenimports ... | Python |
# so vtktud.py uses a list of names to construct the various imports
# at runtime, installer doesn't see this. :(
import os
if os.name == 'posix':
hiddenimports = ['libvtktudCommonPython',
'libvtktudImagingPython', 'libvtktudGraphicsPython',
'libvtktudWidgetsPython']
else:
hiddenimport... | Python |
# this hook is responsible for including everything that the DeVIDE
# modules could need. The top-level spec file explicitly excludes
# them.
import os
import sys
# normalize path of this file, get dirname
hookDir = os.path.dirname(os.path.normpath(__file__))
# split dirname, select everything except the ending "ins... | Python |
hiddenimports = ['wx.aui', 'wx.lib.mixins']
print "[*] hook-wx.py - HIDDENIMPORTS"
print hiddenimports
| 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 |
# 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 |
# this is (possibly broken) code to perform a marker-based watershed
# segmentation on a mesh by making use of a pre-segmentation
# modification of curvature homotopy
# test this on some synthetic data (cube with markers on all six faces)
# before you use it for anything serious.
# IDEA:
# use vtkPolyDataConnectivity... | Python |
import itk
import module_kits.itk_kit as itk_kit
from module_base import ModuleBase
from module_mixins import ScriptedConfigModuleMixin
import math
class BSplineRegistration(ScriptedConfigModuleMixin, ModuleBase):
def __init__(self, module_manager):
ModuleBase.__init__(self, module_manager)
... | Python |
# $Id$
from module_base import ModuleBase
from module_mixins import FilenameViewModuleMixin
import module_utils
import vtk
class ivWRT(FilenameViewModuleMixin, ModuleBase):
def __init__(self, module_manager):
# call parent constructor
ModuleBase.__init__(self, module_manager)
self._write... | 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 vtiWRT(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 vtkStructPtsWRT(FilenameViewModuleMixin, ModuleBase):
def __init__(self, module_manager):
# call parent constructor
ModuleBase.__init__(self, module_manager)
... | Python |
class batchConverter:
kits = ['vtk_kit', 'wx_kit']
cats = ['Readers','Writers','Converters']
keywords = ['batch','convert','read','write','vti','mha','gipl']
help = """Batch converts image volume files from one type to another.
Source and target types can be VTK ImageData (.vti), MetaImage (.mha),
... | 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 ScriptedConfigModuleMixin
import module_utils
import vtk
import wx # needs this for wx.OPEN, we need to make this constant available
# elsewhere
class pngWRT(ScriptedConfigModuleMixin, ModuleBase):
def __init__(self, module_manager):
... | Python |
# BatchConverter.py by Francois Malan - 2010-03-05. Updated 2011-12-11#
import os.path
from module_base import ModuleBase
from module_mixins import ScriptedConfigModuleMixin
import wx
import os
import vtk
import itk
class batchConverter(
ScriptedConfigModuleMixin, ModuleBase):
def __init__(self, module_manag... | Python |
# $Id$
from module_base import ModuleBase
from module_mixins import FilenameViewModuleMixin
import module_utils
import vtk
class cptBrepWRT(FilenameViewModuleMixin, ModuleBase):
def __init__(self, module_manager):
# call parent constructor
ModuleBase.__init__(self, module_manager)
self... | Python |
# $Id$
from module_base import ModuleBase
from module_mixins import ScriptedConfigModuleMixin
import module_utils
import vtk
import wx # need this for wx.SAVE
class metaImageWRT(ScriptedConfigModuleMixin, ModuleBase):
def __init__(self, module_manager):
# call parent constructor
ModuleBase.__ini... | 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 |
# 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.
# 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 stlWRT(FilenameViewModuleMixin, ModuleBase):
def __init__(self, module_manager):
# call parent constructor
ModuleBase.__init__(self, module_manager)
# need to... | 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 |
from module_base import ModuleBase
from module_mixins import NoConfigModuleMixin
import module_utils
import vtk
class testModule(NoConfigModuleMixin, ModuleBase):
def __init__(self, module_manager):
# initialise our base class
ModuleBase.__init__(self, module_manager)
# we'll be playing ... | Python |
import gen_utils
from module_base import ModuleBase
from module_mixins import NoConfigModuleMixin
import module_utils
import vtktud
class imageEigenvectors(ModuleBase, NoConfigModuleMixin):
def __init__(self, module_manager):
# initialise our base class
ModuleBase.__init__(self, module_manager)
... | Python |
import gen_utils
from module_base import ModuleBase
from module_mixins import NoConfigModuleMixin
import module_utils
import vtktud
class imageGradientStructureTensor(ModuleBase, NoConfigModuleMixin):
def __init__(self, module_manager):
# initialise our base class
ModuleBase.__init__(self, module_... | Python |
import gen_utils
from module_base import ModuleBase
from module_mixins import ScriptedConfigModuleMixin
import module_utils
import wx
import vtk
class myTubeFilter(ScriptedConfigModuleMixin, ModuleBase):
"""Simple demonstration of ScriptedConfigModuleMixin-based
wrapping of a single VTK object.
It would ... | Python |
# $Id$
class simplestVTKExample:
kits = ['vtk_kit']
cats = ['User']
class isolated_points_check:
kits = ['vtk_kit']
cats = ['User']
class testModule:
kits = ['vtk_kit']
cats = ['User']
| Python |
import gen_utils
from module_base import ModuleBase
from module_mixins import NoConfigModuleMixin
import module_utils
import vtktud
class imageCurvatureMagnitude(ModuleBase, NoConfigModuleMixin):
def __init__(self, module_manager):
# initialise our base class
ModuleBase.__init__(self, module_manag... | Python |
import gen_utils
from module_base import ModuleBase
from module_mixins import NoConfigModuleMixin
import module_utils
import vtktud
class imageCurvature(ModuleBase, NoConfigModuleMixin):
"""Calculates image curvature with VTKTUD vtkImageCurvature filter.
You need 8 inputs, and in the following sequence: d... | Python |
# $Id: module_index.py 1894 2006-02-23 08:55:45Z cpbotha $
class DilateExample:
kits = ['vtk_kit']
cats = ['User','Cartilage3D']
| Python |
import gen_utils
from module_base import ModuleBase
from module_mixins import ScriptedConfigModuleMixin
import module_utils
import vtk
class DilateExample(ScriptedConfigModuleMixin, ModuleBase):
"""Performs a greyscale 3D dilation on the input.
$Revision: 1.2 $
"""
def __init__(self, module_... | Python |
import gen_utils
from module_base import ModuleBase
from module_mixins import NoConfigModuleMixin
import module_utils
import vtk
import vtkdevide
class imageBacktracker(NoConfigModuleMixin, ModuleBase):
"""JORIK'S STUFF.
"""
def __init__(self, module_manager):
# call parent constructor
M... | Python |
import gen_utils
from module_base import ModuleBase
from module_mixins import NoConfigModuleMixin
import module_utils
import wx
import vtk
import vtkdevide
class modifyHomotopySlow(NoConfigModuleMixin, ModuleBase):
"""
WARNING, WARNING, DANGER WILL ROBINSON: this filter exists purely
for experimental purp... | Python |
from module_mixins import simpleVTKClassModuleBase
import vtk
import vtkdevide
class imageBorderMask(simpleVTKClassModuleBase):
def __init__(self, module_manager):
simpleVTKClassModuleBase.__init__(
self, module_manager,
vtkdevide.vtkImageBorderMask(), 'Creating border mask.',
... | Python |
# $Id$
from module_base import ModuleBase
from module_mixins import ScriptedConfigModuleMixin
import module_utils
import vtktud
class cubicBCSplineKernel(ScriptedConfigModuleMixin, ModuleBase):
"""First test of a cubic B-Spline implicit kernel
$Revision: 1.1 $
"""
def __init__(self, module_manag... | Python |
# $Id$
import fixitk as itk
import gen_utils
from module_base import ModuleBase
import module_utils
import module_utilsITK
from module_mixins import ScriptedConfigModuleMixin
class hessianDoG(ScriptedConfigModuleMixin, ModuleBase):
"""Calculates Hessian matrix of volume by convolution with second and
cross de... | Python |
from module_base import ModuleBase
from module_mixins import NoConfigModuleMixin
import module_utils
import vtk
class reconstructSurface(ModuleBase, NoConfigModuleMixin):
"""Given a binary volume, fit a surface through the marked points.
A doubleThreshold could be used to extract points of interest from
a... | Python |
from module_base import ModuleBase
from module_mixins import NoConfigModuleMixin
import module_utils
import vtk
class testModule2(NoConfigModuleMixin, ModuleBase):
"""Resample volume according to 4x4 homogeneous transform.
"""
def __init__(self, module_manager):
# initialise our base class
... | Python |
from module_base import ModuleBase
from module_mixins import ScriptedConfigModuleMixin
import module_utils
import vtk
import wx
class myImageClip(ScriptedConfigModuleMixin, ModuleBase):
def __init__(self, module_manager):
ModuleBase.__init__(self, module_manager)
self._clipper = vtk.vtkImageClip()... | Python |
# EmphysemaViewerFrame by Corine Slagboom & Noeska Smit
# Description
#
# Based on SkeletonAUIViewerFrame:
# 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.... | Python |
class EmphysemaViewer:
kits = ['vtk_kit']
cats = ['Viewers']
help = """Module to visualize lungemphysema from a CT-thorax scan and a lung mask.
EmphysemaViewer consists of a volume rendering and two linked slice-based views; one with the original data and one with an emphysema overlay. The volume rende... | Python |
# EmphysemaViewer by Corine Slagboom & Noeska Smit
#
#
# Based on SkeletonAUIViewer:
# 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
I... | Python |
# Copyright (c) Charl P. Botha, TU Delft.
# All rights reserved.
# See COPYRIGHT for details.
# ---------------------------------------
# Edited by Corine Slagboom & Noeska Smit to add possibility of adding overlay to the sliceviewer and some special synching.
# And by edited we mean mutilated :)
from module_kits.vtk_... | Python |
# $Id: pngWRT.py 2401 2006-12-20 20:29:15Z cpbotha $
from module_base import ModuleBase
from module_mixins import ScriptedConfigModuleMixin
import module_utils
WX_OPEN = 1
WX_SAVE = 2
class isolated_points_check(ScriptedConfigModuleMixin, ModuleBase):
def __init__(self, module_manager):
# call parent c... | Python |
# $Id$
from module_base import ModuleBase
from module_mixins import ScriptedConfigModuleMixin
import module_utils
import vtktud
class gaussianKernel(ScriptedConfigModuleMixin, ModuleBase):
"""First test of a gaussian implicit kernel
$Revision: 1.1 $
"""
def __init__(self, module_manager):
... | Python |
from module_mixins import simpleVTKClassModuleBase
import vtktud
class imageCopyPad(simpleVTKClassModuleBase):
"""This is the minimum you need to wrap a single VTK object. This
__doc__ string will be replaced by the __doc__ string of the encapsulated
VTK object, i.e. vtkStripper in this case.
With th... | Python |
from module_mixins import simpleVTKClassModuleBase
import vtktud
class imageExtentUnionizer(simpleVTKClassModuleBase):
"""This is the minimum you need to wrap a single VTK object. This
__doc__ string will be replaced by the __doc__ string of the encapsulated
VTK object, i.e. vtkStripper in this case.
... | 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.