Beispiel #1
0
def find_normalization_params(pat_t2w, pat_gt, label):
    # Create the normalization object and load the model
    t2w_norm = RicianNormalization(T2WModality())

    # Read the T2W
    t2w_mod = T2WModality()
    t2w_mod.read_data_from_path(pat_t2w)

    # Read the GT
    gt_mod = GTModality()
    gt_mod.read_data_from_path(label, pat_gt)

    # Find the normalization parameters
    t2w_norm.fit(t2w_mod, ground_truth=gt_mod, cat=label[0])

    return t2w_norm
Beispiel #2
0
def find_normalization_params(pat_dce, pat_gt, label, pat_model):
    # Create the normalization object and load the model
    dce_norm = StandardTimeNormalization(DCEModality())
    dce_norm.load_model(pat_model)

    # Read the DCE
    dce_mod = DCEModality()
    dce_mod.read_data_from_path(pat_dce)

    # Read the GT
    gt_mod = GTModality()
    gt_mod.read_data_from_path(label, pat_gt)

    # Find the normalization parameters
    dce_norm.fit(dce_mod, ground_truth=gt_mod, cat=label[0])

    return dce_norm
def find_normalization_params(pat_adc, pat_gt, label, pat_model):
    # Create the normalization object and load the model
    adc_norm = PiecewiseLinearNormalization(ADCModality())
    adc_norm.load_model(pat_model)

    # Read the ADC
    adc_mod = ADCModality()
    adc_mod.read_data_from_path(pat_adc)

    # Read the GT
    gt_mod = GTModality()
    gt_mod.read_data_from_path(label, pat_gt)

    # Find the normalization parameters
    adc_norm.fit(adc_mod, ground_truth=gt_mod, cat=label[0])

    return adc_norm
Beispiel #4
0
from protoclass.preprocessing import StandardTimeNormalization

# Define the path for the DCE
path_dce = '/data/prostate/experiments/Patient 383/DCE'

# Define the list of path for the GT
path_gt = ['/data/prostate/experiments/Patient 383/GT_inv/prostate']
# Define the associated list of label for the GT
label_gt = ['prostate']

# Read the DCE
dce_mod = DCEModality()
dce_mod.read_data_from_path(path_dce)

# Read the GT
gt_mod = GTModality()
gt_mod.read_data_from_path(label_gt, path_gt)

# Create the object to normalize the DCE data
dce_norm = StandardTimeNormalization(dce_mod)
# Fit the data to get the normalization parameters
dce_norm.partial_fit_model(dce_mod, ground_truth=gt_mod,
                           cat='prostate')

print dce_norm.model_

# Define the path for the DCE
path_dce = '/data/prostate/experiments/Patient 387/DCE'

# Define the list of path for the GT
path_gt = ['/data/prostate/experiments/Patient 387/GT_inv/prostate']