Beispiel #1
0
def test_scmos_scmos_cal():
    """
    Test that scmos calibration data is initialized correctly.
    """
    settings = storm_analysis.getData("test/data/test_sc_2d_fixed.xml")
    parameters = params.ParametersSCMOS().initFromFile(settings)

    # Create analysis object and reach deep into it..
    find_fit = findPeaks.initFindAndFit(parameters)
    fitter = find_fit.peak_fitter
    mfitter = fitter.mfitter

    # Get sCMOS calibration value.
    scmos_cal_value = mfitter.scmos_cal[0,0]
    
    # Initialize with an image.
    image = numpy.ones(mfitter.scmos_cal.shape)
    fitter.newImage(image)

    # Verify that the image has the sCMOS term added.
    resp = mfitter.getResidual()
    assert(numpy.max(resp - (1.0 + scmos_cal_value)) < 1.0e-6)

    # Cleanup.
    fitter.cleanUp()
def analyze(movie_name, mlist_name, settings_name):

    # Load parameters.
    parameters = params.ParametersSCMOS().initFromFile(settings_name)

    # Check for possibly v1.0 parameters.
    if not parameters.hasAttr("background_sigma"):
        raise Exception("Parameter 'background_sigma' is missing. Version 1.0 parameters?")
    
    # Create finding and fitting object.
    finder = find_peaks.initFindAndFit(parameters)

    # Create object for reading sCMOS camera frames.
    frame_reader = analysisIO.FrameReaderSCMOS(movie_file = movie_name,
                                               parameters = parameters)

    # Create movie reader (uses frame reader).
    movie_reader = analysisIO.MovieReader(frame_reader = frame_reader,
                                          parameters = parameters)
    
    # Create localization file writer.
    data_writer = analysisIO.DataWriterHDF5(data_file = mlist_name,
                                            parameters = parameters,
                                            sa_type = 'sCMOS')

    # Run the analysis.
    std_analysis.standardAnalysis(finder,
                                  movie_reader,
                                  data_writer,
                                  parameters)
def test_scmos_scmos_cal():
    """
    Test that scmos calibration data is initialized correctly.
    """
    settings = storm_analysis.getData("test/data/test_sc_2d_fixed.xml")
    parameters = params.ParametersSCMOS().initFromFile(settings)

    # Create analysis object and reach deep into it..
    find_fit = findPeaks.initFindAndFit(parameters)
    fitter = find_fit.peak_fitter
    mfitter = fitter.mfitter

    # Get sCMOS calibration value.
    scmos_cal_value = mfitter.scmos_cal[0, 0]

    # Initialize with an image.
    image = numpy.ones(mfitter.scmos_cal.shape)
    fitter.newImage(image)

    # Verify that the image has the sCMOS term added.
    resp = mfitter.getResidual()
    assert (numpy.max(resp - (1.0 + scmos_cal_value)) < 1.0e-6)

    # Cleanup.
    fitter.cleanUp()
Beispiel #4
0
def analyze(movie_name, mlist_name, settings_name):
    parameters = params.ParametersDAO().initFromFile(settings_name)
    finder = find_peaks.initFindAndFit(parameters)
    std_analysis.standardAnalysis(finder,
                                  movie_name,
                                  mlist_name,
                                  parameters)
def analyze(movie_name, mlist_name, settings_name):

    # Load parameters.
    parameters = params.ParametersSCMOS().initFromFile(settings_name)

    # Check for possibly v1.0 parameters.
    if not parameters.hasAttr("background_sigma"):
        raise Exception(
            "Parameter 'background_sigma' is missing. Version 1.0 parameters?")

    # Create finding and fitting object.
    finder = find_peaks.initFindAndFit(parameters)

    # Create object for reading sCMOS camera frames.
    frame_reader = analysisIO.FrameReaderSCMOS(movie_file=movie_name,
                                               parameters=parameters)

    # Create movie reader (uses frame reader).
    movie_reader = analysisIO.MovieReader(frame_reader=frame_reader,
                                          parameters=parameters)

    # Create localization file writer.
    data_writer = analysisIO.DataWriterHDF5(data_file=mlist_name,
                                            parameters=parameters,
                                            sa_type='sCMOS')

    # Run the analysis.
    std_analysis.standardAnalysis(finder, movie_reader, data_writer,
                                  parameters)
Beispiel #6
0
def test_3ddao_scmos_cal():
    """
    Test that scmos calibration data is initialized to 0.0.
    """
    settings = storm_analysis.getData("test/data/test_3d_2d_fixed.xml")
    parameters = params.ParametersDAO().initFromFile(settings)

    # Create analysis object and reach deep into it..
    find_fit = findPeaks.initFindAndFit(parameters)
    fitter = find_fit.peak_fitter
    mfitter = fitter.mfitter

    # Initialize with an image.
    image = numpy.ones((100, 100))
    fitter.newImage(image)

    # Verify that the image is still all ones.
    resp = mfitter.getResidual()
    assert (numpy.max(resp - 1.0) < 1.0e-6)

    # Cleanup.
    fitter.cleanUp()
Beispiel #7
0
def test_3ddao_scmos_cal():
    """
    Test that scmos calibration data is initialized to 0.0.
    """
    settings = storm_analysis.getData("test/data/test_3d_2d_fixed.xml")
    parameters = params.ParametersDAO().initFromFile(settings)

    # Create analysis object and reach deep into it..
    find_fit = findPeaks.initFindAndFit(parameters)
    fitter = find_fit.peak_fitter
    mfitter = fitter.mfitter

    # Initialize with an image.
    image = numpy.ones((100,100))
    fitter.newImage(image)

    # Verify that the image is still all ones.
    resp = mfitter.getResidual()
    assert(numpy.max(resp - 1.0) < 1.0e-6)

    # Cleanup.
    fitter.cleanUp()
Beispiel #8
0
def analyze(movie_name, mlist_name, settings_name):
    parameters = params.ParametersDAO().initFromFile(settings_name)
    finder = find_peaks.initFindAndFit(parameters)
    std_analysis.standardAnalysis(finder, movie_name, mlist_name, parameters)
Beispiel #9
0
import storm_analysis.daostorm_3d.find_peaks as find_peaks
import storm_analysis.sa_library.parameters as params
import storm_analysis.sa_utilities.std_analysis as std_analysis

# setup
if(len(sys.argv)==3):
    parameters = params.Parameters(sys.argv[2])
    mlist_file = sys.argv[1][:-4] + "_mlist.bin"
elif(len(sys.argv)==4):
    parameters = params.Parameters(sys.argv[3])
    mlist_file = sys.argv[2]
else:
    print("usage: <movie> <bin> <parameters.xml>")
    exit()

finder = find_peaks.initFindAndFit(parameters)
std_analysis.standardAnalysis(finder,
                              sys.argv[1],
                              mlist_file,
                              parameters)

#
# The MIT License
#
# Copyright (c) 2013 Zhuang Lab, Harvard University
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is