コード例 #1
0
    def __init__(self, f, group_name, postfix, params):
        self.fn = f.filename
        self.postfix = postfix
        self.group_name = group_name
        if identifycluster.getname() == 'snowden':
            my_threads = 16
        else:
            my_threads = 4

#    self.params = dict(
#      res=(1400,1400),
#      aa=4,
#      colored_slice=True,
#      out_alpha=True,
#      num_threads=my_threads,
#      temp_file_dir = '/tmp',
#      cam = 'topdown'
#    )
#    self.params.update(params)
        params.threads = my_threads
        self.params = params
        self.runtime_and_mem = estimateRuntimeAndMemory(f[self.group_name])
コード例 #2
0
import qsub
import third_party
import third_party.ffmpy
import collections
import shutil

#import krebs.povrayRenderVessels
from krebs.povrayRenderVessels import addVesselTree, cm_redblue
from krebs.povrayEasy import *
import krebs.povrayRenderSettings
from krebsjobs.submitPovrayRender import RenderJob
from krebsjobs.submitPovrayRender import clientfunc

import datetime
import identifycluster
if (identifycluster.getname() == 'snowden'):
    FFMPEG_BIN = "ffmpeg_latest"
else:
    FFMPEG_BIN = "ffmpeg"  # on Linux ans Mac OS

colors = [(0., 0.2, 0., 0.), (1., 0., 1.0, 0.)]
cm_gf = matplotlib.colors.LinearSegmentedColormap('', {
    'red': [(x, r, r) for (x, r, g, b) in colors],
    'green': [(x, g, g) for (x, r, g, b) in colors],
    'blue': [(x, b, b) for (x, r, g, b) in colors],
},
                                                  N=256,
                                                  gamma=1.)


def renderSliceWithDistribution(vesselgroup, imagefn, options):
コード例 #3
0
ファイル: mpl_utils.py プロジェクト: gitUmaru/tumorcode
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
'''

import os
import numpy as np

import matplotlib

import identifycluster
if (identifycluster.getname()=='snowden' or identifycluster.getname()=='durga'):
  matplotlib.use('agg')

''' pay attention: most likely this functions are imported somewhere else'''
#from mpl_toolkits.axes_grid1.inset_locator import inset_axes
from mpl_toolkits.axes_grid1.anchored_artists import AnchoredSizeBar
#from mpl_toolkits.axes_grid.anchored_artists import AnchoredText
''' needed to plot iff and drug stuff '''
from mpl_toolkits.axes_grid1 import make_axes_locatable
import matplotlib.gridspec as gridspec
from matplotlib.offsetbox import AnchoredOffsetbox, AuxTransformBox, VPacker,\
     TextArea, DrawingArea

class PdfWriter(object):
  def __init__(self, filename, multipage=True, absorbExtension_ = True):
    import matplotlib.backends.backend_pdf as be
コード例 #4
0
ファイル: myutils.py プロジェクト: gitUmaru/tumorcode
from os.path import join, basename, dirname, splitext
import os
import h5py
import numpy as np
import collections
import posixpath
import fnmatch
import posixpath
import md5
import cPickle
import uuid
import decimal

import identifycluster

if identifycluster.getname() == 'snowden':
    cluster_threads = 16
elif identifycluster.getname() == 'durga':
    cluster_threads = 6
else:
    cluster_threads = 4

commonprefix = posixpath.commonprefix


def commonsuffix(l):
    rev = map(lambda s: s[::-1], l)
    ret = commonprefix(rev)
    ret = ret[::-1]
    return ret