py4sci

Previous topic

Installing SLOTH

This Page

The supporting stuff

Although SLOTH is can be directly used by running the built-in scripts, you might want to check out some of the functions, for building your own SLOTH.

class sloth.data_reader.Data_Reader(filename)[source]

reader object for image analyser output

sloth.data_reader.error_filter(data, max_displacement, pixelsize)[source]

data is a list of data eg. [length, errors]^T, at position 0 needs to be the length.

sloth.data_reader.read_data(generator, columns)[source]

reads the columns specified as [] from data.

sloth.data_reader.speed_filter(data, max_speed, framerate, pixelsize)[source]

data is a list of data eg. [length, errors]^T, at position 0 needs to be the length.

sloth.seed_detection.FindOptimalDirections(first_image, seed_coordinates, width, options)[source]

elongates an object by options[“STEP LENGTH”] if this gains enough intensity.

sloth.seed_detection.calculate_coordinates(midpoint, p1, test_len)[source]

transfers output to real coordinates

sloth.seed_detection.detect_objects(image, width, height, parameter)[source]

detect objects line by line by checking for a certain limit

sloth.seed_detection.draw_line(image, color, x1, y1, x2, y2)[source]

simple bresenham

sloth.seed_detection.fit_direction(image, objects)[source]

takes an object(group of pixels in an image) and finds a major axis by linear least squares fit with pixel intensity weights.

sloth.seed_detection.new_object(objects, hints, y, xmin, xmax)[source]

add a new horizontal line segment as new object and merge with old objects

class sloth.image_processing.MyImageFile(filename, dual_color, shift=1)[source]

Abstracts from file format like nd2 or tiff

get_frame(number)[source]

returns frame(number) of a MyImageFile object

sloth.image_processing.RotatingIntensity(image, linear_image, axis, direction, alpha_min, alpha_max, step, center=True)[source]

Rotate microtubule to maximum intensity. If center is False, the rotation axis is the start point.

sloth.image_processing.ShowCoordinates(image, directions)[source]

Plot coordinates ontop of image with matplotlib.

sloth.image_processing.end_profile(image, start, direction)[source]

Go through image from one endpoint, and record intensity profile.

sloth.image_processing.end_profile2(linear_image, width, start, direction, len_scan)[source]

Go through image from one endpoint, and record intensity profile. Uses linearized array, therefore faster.

sloth.image_processing.error_fit(profile, p0)[source]

least square fit to a fermi function:

p[0]*(1./(np.exp(a*p[1]-p[2])+1))+p[3]
Returns parameters, r^2, fit, the position of the half-maximum and the slope at the half-maximum.
sloth.image_processing.tracker_data(filename)[source]

reads position data (x,y) in file. Data needs to be separated by tab.

sloth.image_processing.vec_intensity(image, pos, direction)[source]

calculates the total intensity along a line, where pos=starting point in the direction given. pos and direction are sloth.vectorial.Vector objects.

sloth.image_processing.vec_intensity2(linear_image, width, pos, direction)[source]

faster intensity calculation

sloth.image_analyser_defs.FermiFitTipPositions(image, start_scan, direction, len_scan)[source]

Fit Fermi-function to data and find x_fwhm for tip position

sloth.image_analyser_defs.FindNewTip(image, objects, d, last_len, options)[source]

calculate a new tip from the objects coordinates, given as (start,direction,midpoint)=objects.

sloth.image_analyser_defs.FineTuneCoordinates(first_image, seed_coordinates, options)[source]

takes list of coordinates,an image and a length scan option to determine the exact tip using a fit function.

sloth.image_analyser_defs.RotatingIntensity(image, linear_image, axis, direction, alpha_min, alpha_max, step, center=True)[source]

Rotate microtubule to maximum intensity. If center is False, the rotation axis is the start point.

sloth.mean_square_analyser.lq_diffusion_fit_constrained(times, msq_data, errors, p0)[source]

takes 3 arrays time and msq and errors (SD or SEm) fits a diffusion model with 3 params

y= (p[0]*x)**2+p[1]*x+p[2] return values are: parameters (a,b,c), fit at the x values and the covariance matrix.

sloth.mean_square_analyser.msq_from_data_lsq(length, dt, p0)[source]

calculates mean square displacement values for a series of lengths. Time intervals are taken as powers of 2 to avoid correlations.

sloth.mean_square_analyser.tracker_data_2(workingDir)[source]

reads and averages coordinates in folder

sloth.mean_square_analyser.welch_test(x, y, semx, semy, dofx, dofy)[source]

returns t and dof for welchs unpaired t test

members:
sloth.select_ROI_defs.growth_speed(length1, framerate, linreg=False, start=0, end=10000, output=True)[source]

input is length data as read in read data. performs linear least-squares fit. output=False suppresses plotting.

sloth.select_ROI_defs.make_kymo(data, filename_movie, framerate, twocolor)[source]

produces a kymograph from tip data and movie

sloth.select_ROI_defs.show_movie(filename, fps=0.1, start=0)[source]

dispays nd2 movie from start to end

class sloth.read_nd2.Nd2File(f)[source]

Read Nikon ND2 format as produced by NIS-Elements AR 4.00.03 (Build 775)

read_chunkmap()[source]

read the map of the chunks at the end of the file

read_coordinates()[source]

read the microscope coordinates and temperatures Missing: get chunknames and types from xml metadata