예제 #1
0
    import sa_library.datareader as datareader
    import sa_library.parameters as parameters
    import setup_A_matrix

    if (len(sys.argv) != 3):
        print("usage <dax> <xml>")
        exit()

    dax_file = datareader.DaxReader(sys.argv[1])
    params = parameters.Parameters(sys.argv[2])

    a_mat_file = params.a_matrix

    print("Using A matrix file:", a_mat_file)
    a_mat = setup_A_matrix.loadAMatrix(a_mat_file)

    image = dax_file.loadAFrame(30)
    htia = HomotopyIA(a_mat, params.epsilon, image.shape)

    hres_image = htia.analyzeImage(image)
    [cs_x, cs_y, cs_a, cs_i] = htia.getPeaks(hres_image)
    print("Number peaks:", cs_x.size)

    htia.printProfilingData()

#
# See the accompanying license.txt file.
#
# Copyright (c) 2013 Zhuang Lab, Harvard University
#
예제 #2
0
import homotopy_c
import sa_library.datareader as datareader
import sa_library.daxwriter as daxwriter
import setup_A_matrix

# Setup.

src_directory = os.path.dirname(__file__)

if (len(sys.argv) != 3):
    print("usage: homotopy_vs_fista <input_dax_file> <a_matrix>")
    exit()

in_dax_file = datareader.DaxReader(sys.argv[1])

a_mat = setup_A_matrix.loadAMatrix(sys.argv[2])

x_start = 20
y_start = 20
aoi_size = 7
keep_size = 5
scale = 8
blocks = 3

low_res = numpy.zeros((blocks * keep_size, blocks * keep_size))
ht_hres = numpy.zeros((blocks * keep_size * scale, blocks * keep_size * scale))
fista_hres = numpy.zeros((ht_hres.shape))

# Initialize solvers

print("Initializing solvers")
예제 #3
0
#
# FIXME:
#
# This should also start at the same frame as hres in the event of a restart.
#
i3_file = writeinsight3.I3Writer(sys.argv[4])

params = parameters.Parameters(sys.argv[2])

#
# Load the a matrix and setup the homotopy image analysis class.
#
a_mat_file = params.a_matrix

print "Using A matrix file:", a_mat_file
a_mat = setup_A_matrix.loadAMatrix(a_mat_file)

image = dax_file.loadAFrame(0)
htia = homotopy_imagea_c.HomotopyIA(a_mat,
                                    params.epsilon,
                                    image.shape)

#
# This opens the file. If it already exists, then it sets the file pointer
# to the end of the file & returns the number of the last frame analyzed.
#
curf = htia.openHRDataFile(sys.argv[3])

#
# Figure out which frame to start & stop at.
#
예제 #4
0
import sa_library.datareader as datareader
import sa_library.daxwriter as daxwriter
import setup_A_matrix


# Setup.

src_directory = os.path.dirname(__file__)

if len(sys.argv) != 3:
    print("usage: homotopy_vs_fista <input_dax_file> <a_matrix>")
    exit()

in_dax_file = datareader.DaxReader(sys.argv[1])

a_mat = setup_A_matrix.loadAMatrix(sys.argv[2])

x_start = 20
y_start = 20
aoi_size = 7
keep_size = 5
scale = 8
blocks = 3

low_res = numpy.zeros((blocks * keep_size, blocks * keep_size))
ht_hres = numpy.zeros((blocks * keep_size * scale, blocks * keep_size * scale))
fista_hres = numpy.zeros((ht_hres.shape))


# Initialize solvers