Beispiel #1
0
from make_membrane_label import ImageFileProcessing

__author__ = 'jhennies'

imagePath = '/windows/mobi/h1.hci/isbi_2013/data/xytc_boundaries.bl1.ign4.sparse/'
imageFile = 'xytc_boundaries.bl1.ign4.sparse1eq2.h5'
imageName = None
imageID = 0

# Initialize ImageFileProcessing object
ifp = ImageFileProcessing()
ifp.set_file(imagePath, imageFile, imageName, imageID)

num_lab2 = ifp.count_labels(label=2)
print num_lab2
num_lab1 = ifp.count_labels(label=1)
print num_lab1
n_lab1 = num_lab1 - 100000
n_lab2 = num_lab2 - 100000

ifp.randomly_convert_labels_h5(from_label=1,
                               to_label=0,
                               n=n_lab1,
                               file_name=None)
ifp.randomly_convert_labels_h5(
    from_label=2,
    to_label=0,
    n=n_lab2,
    file_name='xytc_boundaries.bl1.ign4.sparse100k.h5')

# ifp.randomly_convert_labels_h5(from_label=1, to_label=0, n=1000,
Beispiel #2
0
from make_membrane_label import ImageFileProcessing

__author__ = 'jhennies'

imagePath = '/windows/mobi/h1.hci/isbi_2013/prediction/20160105.blNone.ign4.ignl1.sparse10k/'
imageFile = 'xytc_test-data-probs_probs.h5'
imageName = None
imageID = 0

# Initialize ImageFileProcessing object
ifp = ImageFileProcessing()
ifp.set_file(imagePath, imageFile, imageName, imageID)

# Split data
ifp.split_data_h5(file_name='split_data.h5', split_dimension=4, squeeze=True)
from make_membrane_label import ImageFileProcessing

__author__ = 'jhennies'

imagePath = '/windows/mobi/h1.hci/isbi_2013/data/'
imageFile = 'xytc_boundaries.bl1.ign4.h5'
imageName = None
imageID = 0

# Initialize ImageFileProcessing object
ifp = ImageFileProcessing()
ifp.set_file(imagePath, imageFile, imageName, imageID)

num_lab2 = ifp.count_labels(label=2)
print num_lab2
num_lab1 = ifp.count_labels(label=1)
print num_lab1
n = num_lab1 - num_lab2
if n > 0:
    ifp.randomly_convert_labels_h5(from_label=1, to_label=0, n=n,
                                   file_name='xytc_boundaries.bl1.ign4.sparse1eq2.h5')
else:
    print 'n <= 0'
    def make_h5_zeros(self, path, h5name, size):

        ifp = ImageFileProcessing()
        data = np.zeros(size, dtype=int)
        ifp.write_h5(path, data, h5name)
Beispiel #5
0
from make_membrane_label import ImageFileProcessing

__author__ = 'jhennies'

imagePath = '/windows/mobi/h1.hci/isbi_2013/data/'
imageFile = 'test-input.h5'
imageName = None
imageID = 0

# Initialize ImageFileProcessing object
ifp = ImageFileProcessing()
ifp.set_file(imagePath, imageFile, imageName, imageID)

# # Crop image if necessary, then re-run with cropped image
# ifp.crop_h5((100, 100, 100))
# quit()

ifp.stack_h5('test-data-probs.h5',
             '/windows/mobi/h1.hci/isbi_2013/data/test-probs-nn-m.h5',
             stack_id=0)