addpath('C:\Documents and Settings\Steve\My Documents\Research\matlab') addpath('C:\Documents and Settings\Steve\My Documents\Research\optNew\linlsqUtil') petFileName = 'C:\Documents and Settings\Steve\My Documents\Research\optNew\linlsqOpt\input\PET004cuATSM\cu64prescInput.mat' PET = load(petFileName); PETsparse = sparse3D(PET.data); % PET = am2geom(petFileName); % TDP = open_presc('C:\Documents and Settings\Steve\My Documents\Research\optNew\linlsqOpt\input\HN003uniPrescVolNew\PTV70dosePlus.bin'); % TDPfull = full3D(TDP); % TDPbinary = single(~~TDPfull); % PETcorrected = PET.data.*TDPbinary; % PETsparse = sparse3D(PETcorrected); PETnorm = PETsparse.non_zero_values./(max(PETsparse.non_zero_values)); ind30 = {}; ind20 = {}; ind15 = {}; ind6 = {}; ind3 = {}; for i=1:30; ind30{i} = find(PETnorm.non_zero_values >= (i-1)./30 && PETnorm.non_zero_values < i./30)); PETnorm.non_zero_values(ind30{i}) = i.; end PETpresc1 = 100.+PETnorm.non_zero_values; PETnorm = PETsparse.non_zero_values./(max(PETsparse.non_zero_values)); for i=1:20; ind20{i} = find(PETnorm.non_zero_values >= (i-1)./20 && PETnorm.non_zero_values < i./20)); PETnorm.non_zero_values(ind20{i}) = 1.5*i.; end PETpresc15 = 100.+PETnorm.non_zero_values; PETnorm = PETsparse.non_zero_values./(max(PETsparse.non_zero_values)); for i=1:15; ind15{i} = find(PETnorm.non_zero_values >= (i-1)./15 && PETnorm.non_zero_values < i./15)); PETnorm.non_zero_values(ind15{i}) = 2*i.; end PETpresc2 = 100.+PETnorm.non_zero_values; PETnorm = PETsparse.non_zero_values./(max(PETsparse.non_zero_values)); for i=1:6; ind6{i} = find(PETnorm.non_zero_values >= (i-1)./6 && PETnorm.non_zero_values < i./6)); PETnorm.non_zero_values(ind6{i}) = 5*i.; end PETpresc5 = 100.+PETnorm.non_zero_values; PETnorm = PETsparse.non_zero_values./(max(PETsparse.non_zero_values)); for i=1:3; ind3{i} = find(PETnorm.non_zero_values >= (i-1)./3 && PETnorm.non_zero_values < i./3)); PETnorm.non_zero_values(ind15{i}) = 10*i.; end PETpresc10 = 100.+PETnorm.non_zero_values; mkdir('linDiscrete1'); cd('linDiscrete1'); write_presc(PETpresc1); cd(..); mkdir('linDiscrete15'); cd('linDiscrete15'); write_presc(PETpresc15); cd(..); mkdir('linDiscrete2'); cd('linDiscrete2'); write_presc(PETpresc2); cd(..); mkdir('linDiscrete5'); cd('linDiscrete5'); write_presc(PETpresc5); cd(..); mkdir('linDiscrete10'); cd('linDiscrete10'); write_presc(PETpresc10); cd(..);