def main(net_output_filename, image_filename, output_filename):

	print "Importing data..."
	net_output = emio.znn_img_read(net_output_filename)
	image = emio.znn_img_read(image_filename)

	print "Cropping channel data..."
	#cropping the channel data to the 3d shape of the affinity graph
	cropped_image = crop(image, net_output.shape[-3:])

	image_outname = 'channel_{}'.format(path.basename(output_filename))

	print "Writing network output file..."
	write_affinity_file(net_output, output_filename)
	print "Writing image file..."
	write_channel_file(cropped_image, image_outname)
Example #2
0
def main(net_output_filename, image_filename, output_filename):

    print "Importing data..."
    net_output = emio.znn_img_read(net_output_filename)
    image = emio.znn_img_read(image_filename)

    print "Cropping channel data..."
    #cropping the channel data to the 3d shape of the affinity graph
    cropped_image = crop(image, net_output.shape[-3:])

    image_outname = 'channel_{}'.format(path.basename(output_filename))

    print "Writing network output file..."
    write_affinity_file(net_output, output_filename)
    print "Writing image file..."
    write_channel_file(cropped_image, image_outname)
Example #3
0
def main(filename, fov_x, fov_y, fov_z, outname):

	print "Reading data..."
	original_data = emio.znn_img_read(filename)
	assert len(original_data.shape) == 3

	buffer_sizes = np.array((fov_z, fov_y, fov_x)) / 2

	print "Buffering..."
	result = mirror_data(original_data, buffer_sizes)

	print "Saving..."
	emio.znn_img_save(result, outname)
Example #4
0
def main(filename, fov_x, fov_y, fov_z, outname):

    print "Reading data..."
    original_data = emio.znn_img_read(filename)
    assert len(original_data.shape) == 3

    buffer_sizes = np.array((fov_z, fov_y, fov_x)) / 2

    print "Buffering..."
    result = mirror_data(original_data, buffer_sizes)

    print "Saving..."
    emio.znn_img_save(result, outname)
Example #5
0
def load_data(output_fname):

	if 'h5' not in output_fname:
		vol = emio.znn_img_read(output_fname)

		if len(vol.shape) > 3:
			if vol.shape[0] > 2: #multiclass output
				vol = vol[0,:,:,:]
				# vol = np.argmax(vol, axis=0)
			else: #binary output
				vol = vol[0,:,:,:]
	else:
		f = h5py.File(output_fname)
		vol = f['/main'] 

	return vol
Example #6
0
def load_data(output_fname):

    if 'h5' not in output_fname:
        vol = emio.znn_img_read(output_fname)

        if len(vol.shape) > 3:
            if vol.shape[0] > 2:  #multiclass output
                vol = vol[0, :, :, :]
                # vol = np.argmax(vol, axis=0)
            else:  #binary output
                vol = vol[0, :, :, :]
    else:
        f = h5py.File(output_fname)
        vol = f['/main']

    return vol