Esempio n. 1
0
def generate_training_data():
    file_name_save = os.path.join(NPZ_DIR, PREFIX, DATA_FILE)
    num_of_features = 2  # Specify the number of feature masks that are present
    window_size = (30, 30)  # Size of window around pixel
    training_direcs = ['set1', 'set2']
    channel_names = ['Phase']
    raw_image_direc = 'raw'
    annotation_direc = 'annotated'

    # Create the training data
    make_training_data(
        direc_name=os.path.join(DATA_DIR, PREFIX),
        dimensionality=2,
        max_training_examples=1e6,  # Define maximum number of training examples
        window_size_x=window_size[0],
        window_size_y=window_size[1],
        border_mode=BORDER_MODE,
        file_name_save=file_name_save,
        training_direcs=training_direcs,
        channel_names=channel_names,
        num_of_features=num_of_features,
        raw_image_direc=raw_image_direc,
        annotation_direc=annotation_direc,
        reshape_size=RESHAPE_SIZE if RESIZE else None,
        edge_feature=[1, 0, 0],  # Specify which feature is the edge feature,
        dilation_radius=1,
        output_mode=DATA_OUTPUT_MODE,
        display=False,
        verbose=True)
direc_name = '/data/training_data/nuclei_broad/'
file_name_save = os.path.join('/data/training_data_npz/nuclei_broad/',
                              'nuclei_broad_valid_conv_61x61.npz')
training_direcs = ['set1', 'set2', 'set3', 'set4', 'set5']
channel_names = ['nuclear']

# Specify the number of feature masks that are present
num_of_features = 2

# Specify which feature is the edge feature
edge_feature = [1, 0, 0]

# Create the training data
make_training_data(max_training_examples=max_training_examples,
                   window_size_x=window_size,
                   window_size_y=window_size,
                   direc_name=direc_name,
                   file_name_save=file_name_save,
                   training_direcs=training_direcs,
                   channel_names=channel_names,
                   num_of_features=2,
                   edge_feature=edge_feature,
                   dilation_radius=0,
                   border_mode="valid",
                   sample_mode="all",
                   output_mode="conv",
                   reshape_size=512,
                   display=False,
                   verbose=True,
                   process_std=False)
from deepcell import make_training_data_2d as make_training_data

# Define maximum number of training examples
max_training_examples = 1e6
window_size = 30

# Load data
direc_name = '/data/training_data/HeLa_joint/'
file_name_save = os.path.join('/data/training_data_npz/HeLa/', 'HeLa_joint_sample_61x61.npz')
training_direcs = ['set1', 'set2', 'set3', 'set4', 'set5']
channel_names = ['phase', 'nuclear']

# Specify the number of feature masks that are present
num_of_features = 2

# Specify which feature is the edge feature
edge_feature = [1,0,0]

# Create the training data
make_training_data(max_training_examples = max_training_examples, window_size_x = window_size, window_size_y = window_size,
		direc_name = direc_name,
		file_name_save = file_name_save,
		training_direcs = training_direcs,
		channel_names = channel_names,
		num_of_features = 2,
		edge_feature = edge_feature,
		dilation_radius = 1,
		display = False,
		verbose = True)
Esempio n. 4
0
channel_names = ["phase"]


# Specify the number of feature masks that are present
num_of_features = 2

# Specify which feature is the edge feature
edge_feature = [1,0,0]

# Create the training data
make_training_data(max_training_examples = max_training_examples, window_size_x = window_size, window_size_y = window_size, 
		direc_name = direc_name,
		file_name_save = file_name_save,
		training_direcs = training_direcs,
		channel_names = channel_names,
		num_of_features = 2,
		edge_feature = edge_feature,
		dilation_radius = 1,
		#sub_sample = True,
		sample_mode = "subsample",
		reshape_size = None,
		display = False,
		verbose = True,
		process_std = True)






Esempio n. 5
0

from deepcell import make_training_data_movie as make_training_data

# Define maximum number of training examples
window_size = 30

# Load data
direc_name = '/data/DL_Training_Data/nuclear_movie'
file_name_save = os.path.join('/data/training_data_npz/nuclear_movie/', 'nuclear_movie_disc_same.npz')
training_direcs = ["set1", "set2"]
channel_names = ["DAPI"]

# Create the training data
make_training_data(window_size_x = 30, window_size_y = 30, 
		direc_name = direc_name,
		file_name_save = file_name_save,
		training_direcs = training_direcs,
		channel_names = channel_names,
		annotation_name = "corrected",
		raw_image_direc = "RawImages",
		annotation_direc = "Annotation",
		border_mode = "same",
		output_mode = "disc",
		num_frames = 60,
		reshaped_size = 256,
		display = False,
		num_of_frames_to_display = 5,
		verbose = True)

    "set1", "set2", "set3", "set4", "set5", "set6", "set7", "set8", "set9"
]
channel_names = ["nuclear"]

# Create output ditrectory, if necessary
pathlib.Path(output_directory).mkdir(parents=True, exist_ok=True)

# Specify the number of feature masks that are present
num_of_features = 2

# Specify which feature is the edge feature
edge_feature = [1, 0, 0]

# Create the training data
make_training_data(max_training_examples=max_training_examples,
                   window_size_x=window_size,
                   window_size_y=window_size,
                   direc_name=direc_name,
                   file_name_save=file_name_save,
                   training_direcs=training_direcs,
                   channel_names=channel_names,
                   num_of_features=2,
                   edge_feature=edge_feature,
                   dilation_radius=1,
                   border_mode="same",
                   output_mode="conv",
                   reshape_size=512,
                   display=False,
                   max_plotted=5,
                   verbose=True)