Skip to content

Commit

Permalink
testing difference in sample skew when fixed ref is opposite side of …
Browse files Browse the repository at this point in the history
…spectrum
  • Loading branch information
julianarhee committed Jun 25, 2016
1 parent b240567 commit 24196b0
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions matlab/sample_V1_features_euclid_fixedref.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
addpath(genpath('./hmaxMatlab'))

source_root='/media/nas/volume1/behavior/stimuli/pnas_morphs/V1features/pov2000_final/';
out_root='/media/nas/volume1/behavior/stimuli/pnas_morphs/samples/V1_euclid_fixedref_reverse/';
out_root='/media/nas/volume1/behavior/stimuli/pnas_morphs/samples/V1_euclid_fixedref_last/';

im_root='/media/nas/volume1/behavior/stimuli/pnas_morphs/POV/pov2000/final/';

Expand Down Expand Up @@ -41,7 +41,8 @@
end
fnames = sort_nat(fnames);

first_im = load([source_root, fnames{1}]);
% first_im = load([source_root, fnames{1}]);
first_im = load([source_root, fnames{end}]);
first_feature_vect = first_im.featureVector; % just need 1st column of corr mat

sprintf('Loaded first feature vector %s from: %s', fnames{1}, source_root)
Expand Down Expand Up @@ -74,7 +75,7 @@
D.first_feature_vect = first_feature_vect;

% save this, bec it takes forever to make...
matname = sprintf('V1_euclid_fixedref_reverse_%s.mat', num2str(length(D.dist_vect)));
matname = sprintf('V1_euclid_fixedref_last_%s.mat', num2str(length(D.dist_vect)));
save([base_dir, matname], 'D')

fprintf('Saved .mat to: %s', [base_dir, matname])
Expand All @@ -94,7 +95,7 @@

%% Load .mat if exists to samlpe:

mname = 'V1_euclid_fixedref_';
mname = 'V1_euclid_fixedref';
base_root = '/media/nas/volume1/behavior/stimuli/pnas_morphs/samples/';

mfiles = dir([base_root,'*.mat']);
Expand All @@ -118,9 +119,16 @@
% lin_samples = linspace(min(distance_vect), max(distance_vect), nmorphs+2); % add 2 to account for anchors
lin_samples = linspace(D.dist_vect(1), D.dist_vect(end), nmorphs+2);

cumsum_total = cumsum(D.dist_vect);

start_point = cumsum_total(1);
end_point = cumsum_total(end);
lin_samples = linspace(start_point, end_point, nmorphs+2);


sample_idxs = [];
for i=1:length(lin_samples)
[c index] = min(abs(D.dist_vect-lin_samples(i)))
[c index] = min(abs(cumsum_total-lin_samples(i)))
sample_idxs = [sample_idxs; index];
end

Expand Down

0 comments on commit 24196b0

Please sign in to comment.