Browse Source

gin commit from arc-osx-003861

Modified files: 113
Deleted files: 41
lindedomingo 1 year ago
parent
commit
132a19f33a
41 changed files with 0 additions and 1753 deletions
  1. BIN
      task/pixelsims/PIXELSIM4Juan/01_church.jpg
  2. BIN
      task/pixelsims/PIXELSIM4Juan/01_lamppost01.jpg
  3. BIN
      task/pixelsims/PIXELSIM4Juan/02_basketballhoop02.jpg
  4. 0 113
      task/pixelsims/PIXELSIM4Juan/PIXELSIM4Juan.m
  5. 0 172
      task/pixelsims/PIXELSIM4Juan/PIXELSIM4JuanJMODS.m
  6. BIN
      task/pixelsims/PIXELSIM4Juan/carfront.bmp
  7. BIN
      task/pixelsims/PIXELSIM4Juan/eiffel2.bmp
  8. 0 11
      task/pixelsims/PIXELSIM4Juan/qlines.m
  9. BIN
      task/pixelsims/PIXELSIM4Juan/stimuli/01_candelabra.jpg
  10. BIN
      task/pixelsims/PIXELSIM4Juan/stimuli/01_church.jpg
  11. BIN
      task/pixelsims/PIXELSIM4Juan/stimuli/01_lamppost01.jpg
  12. BIN
      task/pixelsims/PIXELSIM4Juan/stimuli/01_lighthouse.jpg
  13. BIN
      task/pixelsims/PIXELSIM4Juan/stimuli/01_nightstand.jpg
  14. BIN
      task/pixelsims/PIXELSIM4Juan/stimuli/01_outdoorchair.jpg
  15. BIN
      task/pixelsims/PIXELSIM4Juan/stimuli/02_basketballhoop02.jpg
  16. BIN
      task/pixelsims/PIXELSIM4Juan/stimuli/02_crown.jpg
  17. BIN
      task/pixelsims/PIXELSIM4Juan/stimuli/02_gazebo.jpg
  18. BIN
      task/pixelsims/PIXELSIM4Juan/stimuli/02_gazeboredone.jpg
  19. BIN
      task/pixelsims/PIXELSIM4Juan/stimuli/02_hat04a.jpg
  20. BIN
      task/pixelsims/PIXELSIM4Juan/stimuli/02_radio03a.jpg
  21. BIN
      task/pixelsims/PIXELSIM4Juan/stimuli/02_table03.jpg
  22. BIN
      task/pixelsims/PIXELSIM4Juan/table_rho_pairs.mat
  23. BIN
      task/pixelsims/PIXELSIM4Juan/table_triplets_ave_rho.mat
  24. BIN
      task/pixelsims/previousstuff/3.bmp
  25. BIN
      task/pixelsims/previousstuff/4.bmp
  26. BIN
      task/pixelsims/previousstuff/bear.bmp
  27. BIN
      task/pixelsims/previousstuff/car.bmp
  28. BIN
      task/pixelsims/previousstuff/carfront.bmp
  29. BIN
      task/pixelsims/previousstuff/eiffel2.bmp
  30. 0 165
      task/pixelsims/previousstuff/objori4real.m
  31. 0 165
      task/pixelsims/previousstuff/objori4real_4opts.m
  32. 0 166
      task/pixelsims/previousstuff/objori4real_bear.m
  33. 0 166
      task/pixelsims/previousstuff/objori4real_eiffel_carfront.m
  34. 0 204
      task/pixelsims/previousstuff/objori4real_eiffel_carfront_200114.m
  35. 0 166
      task/pixelsims/previousstuff/objori4real_num.m
  36. 0 165
      task/pixelsims/previousstuff/objori4real_spec.m
  37. BIN
      task/pixelsims/previousstuff/pisa.bmp
  38. 0 11
      task/pixelsims/previousstuff/qlines.m
  39. 0 80
      task/pixelsims/previousstuff/rdm_mds.m
  40. 0 101
      task/pixelsims/previousstuff/rdm_mds_191203.m
  41. 0 68
      task/pixelsims/previousstuff/rdm_sim.m

BIN
task/pixelsims/PIXELSIM4Juan/01_church.jpg


BIN
task/pixelsims/PIXELSIM4Juan/01_lamppost01.jpg


BIN
task/pixelsims/PIXELSIM4Juan/02_basketballhoop02.jpg


+ 0 - 113
task/pixelsims/PIXELSIM4Juan/PIXELSIM4Juan.m

@@ -1,113 +0,0 @@
-clear all;
-
-images={'01_lamppost01';'02_basketballhoop02'} % read in your two pictures
-% annoying hack to move the pic in the exact center. can play with setting
-% these 0 or 1 or 2 until it works with your picture: 
-dc1=[1 1]; % pic 1 
-dc2=[1 1]; % pic 2 
-dim=2000; % size of the entire picture plane in pixels (larger for larger pictures)
-smooth=1;
-
-
-th=linspace(-pi,pi,17); % angles (16 unique orientations)
-th=fliplr(th);
-th=th(1:end-1);
-%degax=rad2deg([th th]); % for plots
-romat=zeros(dim,dim,length(th),length(images));
-
-
-for img=1:length(images)
-
-    %get image
-    A1 = imread([images{img} '.jpg']);
-    A1 = mean(A1(1:(end-1),:,:),3);
-    %place it in center
-    quafig=zeros(dim,dim);
-    pl=round(([dim+1 dim+1]-size(A1))/2);
-    quafig(pl(1):end-pl(1)+dc1(img),pl(2):end-pl(2)+dc2(img))=A1;
-   % if img==1
-       quafig(quafig>=230)=0;
-   % end
-    %figure; imagesc(quafig);
-
-    %% display area / circle 
-    sz=floor(dim/2);
-    [x y] = meshgrid(-sz:sz,-sz:sz);
-    oc = NaN(size(x));
-    oc((x.^2+y.^2)<(dim/2)^2)=1;   % radius outrad, center at the origin
-    %% Gaussian smoothing kernel   
-    f=exp(-x.^2/(2*smooth^2)-y.^2/(2*smooth^2));
-    quafig=conv2(quafig,f,'same');
-    quafig=quafig./max(max(quafig));
-    %% rotate
-    figure;
-    mid=round(dim./2);
-    for t=1:length(th)
-        for i=1:size(quafig,1)
-            for j=1:size(quafig,2)
-
-                 x= (i-mid )*cos(th(t))+(j-mid)*sin(th(t));
-                 y=-(i-mid)*sin(th(t))+(j-mid)*cos(th(t));
-                 x=round(x)+mid;
-                 y=round(y)+mid;
-
-                 if (x>=1 && y>=1 && x<=size(quafig,2) && y<=size(quafig,1))
-                      romat(i,j,t,img)=quafig(x,y); % k degrees rotated image         
-                 end
-            end
-        end
-         subplot(4,4,t);
-         imagesc(romat(:,:,t,img));
-    end
-end
-
-combat=cat(3,romat(:,:,:,1),romat(:,:,:,2));
-tmpsizer=size(romat);
-combat=reshape(romat,[tmpsizer(1:2) tmpsizer(3)*tmpsizer(4)]);
-nth=[th th];
-%% distance (inner product) - Pixel level similarity
-for i=1:length(nth)
-    for j=1:length(nth)
-        ith=reshape(combat(:,:,i).*oc,[dim*dim 1]);
-        jth=reshape(combat(:,:,j).*oc,[dim*dim 1]);
-        ith=ith(~isnan(ith));
-        jth=jth(~isnan(jth));
-        dist(i,j)=1-corr(ith,jth);
-        if i==j
-             dist(i,j)=0;
-             acdist(i,j)=0;
-        end
-        acdist(i,j)=abs(angdiff(nth(i),nth(j)));
-        if (i>length(th) & j<=length(th)) | (j>length(th) & i<=length(th))
-            %acdist(i,j)=0 ; acdist(i,j);
-            dist(i,j)=dist(i,j)+0.2;
-        end
-        %dist(i,j)=nansum(nansum(combat(:,:,i).*combat(:,:,j).*oc)); 
-    end
-end
-figure;
-dotsize=50
-
-% concrete
-ax1=subplot(2,4,1) 
-imagesc(dist);axis off; hold on; qlines(th);
-title('concrete (pixel level)');
-colormap(ax1,'parula')
-
-
-% abstract continuous
-subplot(2,4,2) 
-imagesc(acdist); axis off; hold on; qlines(th); 
-title('abstract continuous');
-
-
-tmpreg1=squareform(dist);
-tmpreg2=squareform(acdist);
-
-%% This is the magic important number: correlation between abstract and concrete RDM
-[Rho p]=corr(tmpreg1',tmpreg2');
-% if RHO is about zero, it is a great picture pair :thumbsup: 
-
-
-
-

+ 0 - 172
task/pixelsims/PIXELSIM4Juan/PIXELSIM4JuanJMODS.m

@@ -1,172 +0,0 @@
-clear all;
-
-
-imageFolder = 'stimuli/';
-imgList = dir(fullfile(imageFolder,['*.' 'jpg']));
-imgList = {imgList(:).name}
-
-
-A = [1:length(imgList)];
-allpairs = nchoosek(A, 2);
-
-for pair=1:length(allpairs)
-
-images={[imageFolder imgList{allpairs(pair,1)}];[imageFolder imgList{allpairs(pair,2)}]}; % read in your two pictures
-% annoying hack to move the pic in the exact center. can play with setting
-% these 0 or 1 or 2 until it works with your picture: 
-dc1=[1 1]; % pic 1   
-dc2=[1 1]; % pic 2
-
-ID_1{pair}=imgList{allpairs(pair,1)};
-ID_2{pair}=imgList{allpairs(pair,2)};
-
-for img=1:length(images) %preloading images
-A0{img} =imread([images{img}]);
-
-A0{img} = imresize(A0{img}, 0.1);%reducing size
-
-if mod(size(A0{img},1),2)==0&mod(size(A0{img},2),2)==0
-    AsO{img} = (A0{img}(1:(end-1),1:(end-1),:)); %stupid way to avoid even number of pixels
-elseif mod(size(A0{img},1),2)==0&mod(size(A0{img},2),2)==1
-    AsO{img} = (A0{img}(1:(end-1),:,:)); %stupid way to avoid even number of pixels
-elseif mod(size(A0{img},1),2)==1&mod(size(A0{img},2),2)==0
-    AsO{img} = (A0{img}(:,1:(end-1),:)); %stupid way to avoid even number of pixels
-end    
-end
-
-
-dim=size(AsO{img},1); % size of the entire picture plane in pixels (larger for larger pictures)
-smooth=1;
-
-
-th=linspace(-pi,pi,17); % angles (16 unique orientations)
-th=fliplr(th);
-th=th(1:end-1);
-%degax=rad2deg([th th]); % for plots
-romat=zeros(dim,dim,length(th),length(AsO));
-
-
-for img=1:length(AsO)
-
-    %get image
-    A1 = AsO{img};
-    A1= mean(A1,3);
-
-    %place it in center
-    quafig=zeros(dim,dim);
-    pl=round(([dim+1 dim+1]-size(A1))/2);
-    quafig(pl(1):end-pl(1)+dc1(img),pl(2):end-pl(2)+dc2(img))=A1;
-   % if img==1
-       quafig(quafig>=230)=0;
-   % end
-    %figure; imagesc(quafig);
-
-    %% display area / circle 
-    sz=floor(dim/2);
-    [x y] = meshgrid(-sz:sz,-sz:sz);
-    oc = NaN(size(x));
-    oc((x.^2+y.^2)<(dim/2)^2)=1;   % radius outrad, center at the origin
-    %% Gaussian smoothing kernel   
-    f=exp(-x.^2/(2*smooth^2)-y.^2/(2*smooth^2));
-    quafig=conv2(quafig,f,'same');
-    quafig=quafig./max(max(quafig));
-    %% rotate
-%     figure;
-    mid=round(dim./2);
-    for t=1:length(th)
-        for i=1:size(quafig,1)
-            for j=1:size(quafig,2)
-
-                 x= (i-mid )*cos(th(t))+(j-mid)*sin(th(t));
-                 y=-(i-mid)*sin(th(t))+(j-mid)*cos(th(t));
-                 x=round(x)+mid;
-                 y=round(y)+mid;
-
-                 if (x>=1 && y>=1 && x<=size(quafig,2) && y<=size(quafig,1))
-                      romat(i,j,t,img)=quafig(x,y); % k degrees rotated image         
-                 end
-            end
-        end
-%          subplot(4,4,t);
-%          imagesc(romat(:,:,t,img));
-    end
-end
-
-combat=cat(3,romat(:,:,:,1),romat(:,:,:,2));
-tmpsizer=size(romat);
-combat=reshape(romat,[tmpsizer(1:2) tmpsizer(3)*tmpsizer(4)]);
-nth=[th th];
-%% distance (inner product) - Pixel level similarity
-for i=1:length(nth)
-    for j=1:length(nth)
-        ith=reshape(combat(:,:,i).*oc,[dim*dim 1]);
-        jth=reshape(combat(:,:,j).*oc,[dim*dim 1]);
-        ith=ith(~isnan(ith));
-        jth=jth(~isnan(jth));
-        dist(i,j)=1-corr(ith,jth);
-        if i==j
-             dist(i,j)=0;
-             acdist(i,j)=0;
-        end
-        acdist(i,j)=abs(angdiff(nth(i),nth(j)));
-        if (i>length(th) & j<=length(th)) | (j>length(th) & i<=length(th))
-            %acdist(i,j)=0 ; acdist(i,j);
-            dist(i,j)=dist(i,j)+0.2;
-        end
-        %dist(i,j)=nansum(nansum(combat(:,:,i).*combat(:,:,j).*oc)); 
-    end
-end
-
-% figure;
-dotsize=50;
-
-% % concrete
-% ax1=subplot(2,4,1) 
-% imagesc(dist);axis off; hold on; qlines(th);
-% title('concrete (pixel level)');
-% colormap(ax1,'parula')
-% 
-% % abstract continuous
-% subplot(2,4,2) 
-% imagesc(acdist); axis off; hold on; qlines(th); 
-% title('abstract continuous');
-
-tmpreg1=squareform(dist);
-tmpreg2=squareform(acdist);
-
-%% This is the magic important number: correlation between abstract and concrete RDM
-[Rho(pair) p(pair)]=corr(tmpreg1',tmpreg2');
-% if RHO is about zero, it is a great picture pair :thumbsup: 
-
-
-end
-%%
-Rho=Rho'
-abs_rho=abs(Rho)
-FINAL_T=table(abs_rho,allpairs,ID_1',ID_2',Rho)
-% FINAL_T = sortrows(FINAL_T,1)
-MMM=[]
-for ppp=1:length(FINAL_T.allpairs)  
-MMM(FINAL_T.allpairs(ppp,1),FINAL_T.allpairs(ppp,2))=FINAL_T.abs_rho(ppp);
-end
-
-figure;
-imagesc(MMM)
-%%
-A = [1:length(imgList)];
-alltriples = nchoosek(A, 3)
-apt = nchoosek(1:3, 2)
-
-for t=1:length(alltriples)
-    st=NaN(1,length(apt))
-    for tt=1:length(apt)        
-       toi=FINAL_T.allpairs(:,1)==alltriples(t,apt(tt,1))&FINAL_T.allpairs(:,2)==alltriples(t,apt(tt,2)) ;    
-       st(tt)=FINAL_T.abs_rho(toi);
-    end
-    ave_abs_rho(t,1)=sum(st)/length(apt);
-end
-
-%%
-
-FINAL_TRIPLETS=table(ave_abs_rho,alltriples)
-FINAL_TRIPLETS = sortrows(FINAL_TRIPLETS,1)

BIN
task/pixelsims/PIXELSIM4Juan/carfront.bmp


BIN
task/pixelsims/PIXELSIM4Juan/eiffel2.bmp


+ 0 - 11
task/pixelsims/PIXELSIM4Juan/qlines.m

@@ -1,11 +0,0 @@
-function qlines(th)
-    fl=2*length(th)+1;
-    hl=fl/2;
-    hold on;
-    plot([0 fl],[hl hl],'k-');
-    plot([0 fl],[0 0],'k-');
-    plot([0 fl],[fl fl],'k-');
-    plot([hl hl],[0 fl],'k-');
-    plot([0 0],[0 fl],'k-');
-    plot([fl fl],[0 fl],'k-');
-end%%

BIN
task/pixelsims/PIXELSIM4Juan/stimuli/01_candelabra.jpg


BIN
task/pixelsims/PIXELSIM4Juan/stimuli/01_church.jpg


BIN
task/pixelsims/PIXELSIM4Juan/stimuli/01_lamppost01.jpg


BIN
task/pixelsims/PIXELSIM4Juan/stimuli/01_lighthouse.jpg


BIN
task/pixelsims/PIXELSIM4Juan/stimuli/01_nightstand.jpg


BIN
task/pixelsims/PIXELSIM4Juan/stimuli/01_outdoorchair.jpg


BIN
task/pixelsims/PIXELSIM4Juan/stimuli/02_basketballhoop02.jpg


BIN
task/pixelsims/PIXELSIM4Juan/stimuli/02_crown.jpg


BIN
task/pixelsims/PIXELSIM4Juan/stimuli/02_gazebo.jpg


BIN
task/pixelsims/PIXELSIM4Juan/stimuli/02_gazeboredone.jpg


BIN
task/pixelsims/PIXELSIM4Juan/stimuli/02_hat04a.jpg


BIN
task/pixelsims/PIXELSIM4Juan/stimuli/02_radio03a.jpg


BIN
task/pixelsims/PIXELSIM4Juan/stimuli/02_table03.jpg


BIN
task/pixelsims/PIXELSIM4Juan/table_rho_pairs.mat


BIN
task/pixelsims/PIXELSIM4Juan/table_triplets_ave_rho.mat


BIN
task/pixelsims/previousstuff/3.bmp


BIN
task/pixelsims/previousstuff/4.bmp


BIN
task/pixelsims/previousstuff/bear.bmp


BIN
task/pixelsims/previousstuff/car.bmp


BIN
task/pixelsims/previousstuff/carfront.bmp


BIN
task/pixelsims/previousstuff/eiffel2.bmp


+ 0 - 165
task/pixelsims/previousstuff/objori4real.m

@@ -1,165 +0,0 @@
-clear all;
-
-images={'car';'pisa'}
-dc=[1 0];
-dim=131;
-smooth=1;
-
-
-th=linspace(-pi,pi,64); % angles
-th=fliplr(th);
-%th=th(1:end-1);
-romat=zeros(dim,dim,length(th),length(images));
-
-
-for img=1:length(images)
-
-    %get image
-    A1 = imread([images{img} '.bmp']);
-    A1 = mean(A1(:,:,:),3);
-    %place it
-    quafig=zeros(dim,dim);
-    pl=round(([dim+1 dim+1]-size(A1))/2);
-    quafig(pl(1):end-pl(1),pl(2):end-pl(2)+dc(img))=A1;
-    if img==1
-  %     quafig(quafig>=255)=0;
-    end
-    %figure; imagesc(quafig);
-
-    %% display area / circle 
-    sz=floor(dim/2);
-    [x y] = meshgrid(-sz:sz,-sz:sz);
-    oc = NaN(size(x));
-    oc((x.^2+y.^2)<(dim/2)^2)=1;   % radius outrad, center at the origin
-    %% Gaussian smoothing kernel   
-    f=exp(-x.^2/(2*smooth^2)-y.^2/(2*smooth^2));
-    quafig=conv2(quafig,f,'same');
-    quafig=quafig./max(max(quafig));
-    %% rotate
-    figure;
-    mid=round(dim./2);
-    for t=1:length(th)
-        for i=1:size(quafig,1)
-            for j=1:size(quafig,2)
-
-                 x= (i-mid)*cos(th(t))+(j-mid)*sin(th(t));
-                 y=-(i-mid)*sin(th(t))+(j-mid)*cos(th(t));
-                 x=round(x)+mid;
-                 y=round(y)+mid;
-
-                 if (x>=1 && y>=1 && x<=size(quafig,2) && y<=size(quafig,1))
-                      romat(i,j,t,img)=quafig(x,y); % k degrees rotated image         
-                 end
-            end
-        end
-%        subplot(4,4,t);
-%        imagesc(romat(:,:,t,img));
-    end
-end
-
-combat=cat(3,romat(:,:,:,1),romat(:,:,:,2));
-tmpsizer=size(romat);
-combat=reshape(romat,[tmpsizer(1:2) tmpsizer(3)*tmpsizer(4)]);
-nth=[th th];
-%% distance (inner product)
-for i=1:length(nth)
-    for j=1:length(nth)
-        ith=reshape(combat(:,:,i).*oc,[dim*dim 1]);
-        jth=reshape(combat(:,:,j).*oc,[dim*dim 1]);
-        ith=ith(~isnan(ith));
-        jth=jth(~isnan(jth));
-        dist(i,j)=1-corr(ith,jth);
-        if i==j
-             dist(i,j)=0;
-             actdist(i,j)=0;
-        end
-        acdist(i,j)=abs(angdiff(nth(i),nth(j)));
-        if (i>length(th) & j<=length(th)) | (j>length(th) & i<=length(th))
-            acdist(i,j)=acdist(i,j)+1;
-            %dist(i,j)=dist(i,j);
-        end
-        %dist(i,j)=nansum(nansum(combat(:,:,i).*combat(:,:,j).*oc)); 
-    end
-end
-figure;
-dotsize=50
-
-% concrete
-ax1=subplot(3,3,1) 
-imagesc(dist);qlines(th) 
-colormap(ax1,'parula')
-
-ax3=subplot(3,3,4) 
-[Y,e] = cmdscale(dist,3);
-Y1=Y(1:length(th),:);
-c = linspace(1,64,length(Y1));
-scatter3(Y1(:,1),Y1(:,2),Y1(:,3),dotsize,c); hold on
-Y2=Y(length(th)+1:end,:);
-scatter3(Y2(:,1),Y2(:,2),Y2(:,3),dotsize,c,'filled');
-colormap(ax3,'hsv')
-
-% abstract continuous
-subplot(3,3,2) 
-imagesc(acdist); qlines(th); 
-[Y,e] = cmdscale(acdist,3);  
-ax4=subplot(3,3,5) 
-Y1=Y(1:length(th),:);
-scatter3(Y1(:,1),Y1(:,2),Y1(:,3),dotsize,c); hold on
-Y2=Y(length(th)+1:end,:);
-scatter3(Y2(:,1),Y2(:,2),Y2(:,3),dotsize,c,'filled');
-colormap(ax4,'hsv');
-%xlim([-2 2]); ylim([-2 2]); zlim([-2 2]);
-
-if length(th)==4
-    ax5=subplot(3,3,3); % abstract-idiosyncratic
-    %x=randn(1,xs); x=x-min(x); x=x./max(x);
-    xs=length(th);
-    x=[2 1.3 7 5]; x=x-min(x); x=x./max(x);
-    y=x+rand(1,xs).*0.3; y=y-min(y); y=y./max(y);
-    x=[x y];
-    rdm=NaN(length(x),length(x));
-    for i=1:length(x)
-        for j=1:length(x)
-            rdm(i,j)=abs(x(i)-x(j));
-            if abs(i-j)>xs
-                rdm(i,j)=rdm(i,j)+rand.*0.5;
-            end
-        end
-    end
-    tmp=squareform(rdm);
-    tmpreg=squareform(dist);
-    tmp=tmp-min(tmp); tmp=tmp./max(tmp);
-    [b,dev,stats]=glmfit(tmpreg,tmp);
-    tmp=stats.resid;
-    tmp=tmp-min(tmp); tmp=tmp./max(tmp);
-    rdm=squareform(tmp)
-    imagesc(rdm); axis off; hold on; qlines(th);
-    
-    ax6=subplot(3,3,6) 
-    [Y,e] = cmdscale(rdm,3); 
-    Y1=Y(1:length(th),:);
-    scatter3(Y1(:,1),Y1(:,2),Y1(:,3),dotsize,c); hold on
-    Y2=Y(length(th)+1:end,:);
-    scatter3(Y2(:,1),Y2(:,2),Y2(:,3),dotsize,c,'filled');
-    colormap(ax6,'hsv');
-    %xlim([-2 2]); ylim([-2 2]); zlim([-2 2]);
-end
-
-
-tmpreg1=squareform(dist);
-tmpreg2=squareform(acdist);
-
-% abstract discrete (tbd) 
-quadrlth=(length(th)^2-length(th))./2;
-rand(quadrlth,1);
-
-
-
-
-
-%%
-
-
-
-
-

+ 0 - 165
task/pixelsims/previousstuff/objori4real_4opts.m

@@ -1,165 +0,0 @@
-clear all;
-
-images={'car';'pisa'}
-dc=[1 0];
-dim=131;
-smooth=1;
-
-
-th=linspace(-pi/4,pi/4,4); % angles
-th=fliplr(th);
-%th=th(1:end-1);
-romat=zeros(dim,dim,length(th),length(images));
-
-
-for img=1:length(images)
-
-    %get image
-    A1 = imread([images{img} '.bmp']);
-    A1 = mean(A1(:,:,:),3);
-    %place it
-    quafig=zeros(dim,dim);
-    pl=round(([dim+1 dim+1]-size(A1))/2);
-    quafig(pl(1):end-pl(1),pl(2):end-pl(2)+dc(img))=A1;
-    if img==1
-       quafig(quafig>=255)=0;
-    end
-    %figure; imagesc(quafig);
-
-    %% display area / circle 
-    sz=floor(dim/2);
-    [x y] = meshgrid(-sz:sz,-sz:sz);
-    oc = NaN(size(x));
-    oc((x.^2+y.^2)<(dim/2)^2)=1;   % radius outrad, center at the origin
-    %% Gaussian smoothing kernel   
-    f=exp(-x.^2/(2*smooth^2)-y.^2/(2*smooth^2));
-    quafig=conv2(quafig,f,'same');
-    quafig=quafig./max(max(quafig));
-    %% rotate
-    figure;
-    mid=round(dim./2);
-    for t=1:length(th)
-        for i=1:size(quafig,1)
-            for j=1:size(quafig,2)
-
-                 x= (i-mid)*cos(th(t))+(j-mid)*sin(th(t));
-                 y=-(i-mid)*sin(th(t))+(j-mid)*cos(th(t));
-                 x=round(x)+mid;
-                 y=round(y)+mid;
-
-                 if (x>=1 && y>=1 && x<=size(quafig,2) && y<=size(quafig,1))
-                      romat(i,j,t,img)=quafig(x,y); % k degrees rotated image         
-                 end
-            end
-        end
-        subplot(4,4,t);
-        imagesc(romat(:,:,t,img));
-    end
-end
-
-combat=cat(3,romat(:,:,:,1),romat(:,:,:,2));
-tmpsizer=size(romat);
-combat=reshape(romat,[tmpsizer(1:2) tmpsizer(3)*tmpsizer(4)]);
-nth=[th th];
-%% distance (inner product)
-for i=1:length(nth)
-    for j=1:length(nth)
-        ith=reshape(combat(:,:,i).*oc,[dim*dim 1]);
-        jth=reshape(combat(:,:,j).*oc,[dim*dim 1]);
-        ith=ith(~isnan(ith));
-        jth=jth(~isnan(jth));
-        dist(i,j)=1-corr(ith,jth);
-        if i==j
-             dist(i,j)=0;
-             actdist(i,j)=0;
-        end
-        acdist(i,j)=abs(angdiff(nth(i),nth(j)));
-        if (i>length(th) & j<=length(th)) | (j>length(th) & i<=length(th))
-            acdist(i,j)=acdist(i,j)+0.0001;
-            %dist(i,j)=dist(i,j);
-        end
-        %dist(i,j)=nansum(nansum(combat(:,:,i).*combat(:,:,j).*oc)); 
-    end
-end
-figure;
-dotsize=50
-
-% concrete
-ax1=subplot(3,3,1) 
-imagesc(dist);qlines(th) 
-colormap(ax1,'parula')
-
-ax3=subplot(3,3,4) 
-[Y,e] = cmdscale(dist,3);
-Y1=Y(1:length(th),:);
-c = linspace(1,64,length(Y1));
-plot3(Y1(:,1),Y1(:,2),Y1(:,3),'.-'); hold on
-Y2=Y(length(th)+1:end,:);
-plot3(Y2(:,1),Y2(:,2),Y2(:,3),'.-');
-colormap(ax3,'hsv')
-
-% abstract continuous
-subplot(3,3,2) 
-imagesc(acdist); qlines(th); 
-[Y,e] = cmdscale(acdist,3);  
-ax4=subplot(3,3,5) 
-Y1=Y(1:length(th),:);
-plot3(Y1(:,1),Y1(:,2),Y1(:,3),'.-'); hold on
-Y2=Y(length(th)+1:end,:);
-plot3(Y2(:,1),Y2(:,2),Y2(:,3),'.-');
-colormap(ax4,'hsv');
-%xlim([-2 2]); ylim([-2 2]); zlim([-2 2]);
-
-
-tmpreg1=squareform(dist);
-tmpreg2=squareform(acdist);
-if length(th)==4
-    ax5=subplot(3,3,3); % abstract-idiosyncratic
-    %x=randn(1,xs); x=x-min(x); x=x./max(x);
-    xs=length(th);
-    x=[2 1.3 7 5]; x=x-min(x); x=x./max(x);
-    y=x+rand(1,xs).*0.3; y=y-min(y); y=y./max(y);
-    x=[x y];
-    rdm=NaN(length(x),length(x));
-    for i=1:length(x)
-        for j=1:length(x)
-            rdm(i,j)=abs(x(i)-x(j));
-            if abs(i-j)>xs
-                rdm(i,j)=rdm(i,j)+rand.*0.5;
-            end
-        end
-    end
-    tmp=squareform(rdm);
-
-
-    tmp=tmp-min(tmp); tmp=tmp./max(tmp);
-    [b,dev,stats]=glmfit([tmpreg1' tmpreg2'],tmp);
-    tmp=stats.resid;
-    tmp=tmp-min(tmp); tmp=tmp./max(tmp);
-    rdm=squareform(tmp)
-    imagesc(rdm); axis off; hold on; qlines(th);
-    
-    ax6=subplot(3,3,6) 
-    [Y,e] = cmdscale(rdm,3); 
-    Y1=Y(1:length(th),:);
-    plot3(Y1(:,1),Y1(:,2),Y1(:,3),'.-'); hold on
-    Y2=Y(length(th)+1:end,:);
-    plot3(Y2(:,1),Y2(:,2),Y2(:,3),'.-');
-    colormap(ax6,'hsv');
-    %xlim([-2 2]); ylim([-2 2]); zlim([-2 2]);
-end
-
-% abstract discrete (tbd) 
-quadrlth=(length(th)^2-length(th))./2;
-rand(quadrlth,1);
-
-
-
-
-
-%%
-
-
-
-
-

+ 0 - 166
task/pixelsims/previousstuff/objori4real_bear.m

@@ -1,166 +0,0 @@
-clear all;
-
-images={'bear';'bear'}
-dc1=[1 1]
-dc2=[0 0];
-dim=131;
-smooth=1;
-
-
-th=linspace(-pi,pi,16); % angles
-th=fliplr(th);
-%th=th(1:end-1);
-romat=zeros(dim,dim,length(th),length(images));
-
-
-for img=1:length(images)
-
-    %get image
-    A1 = imread([images{img} '.bmp']);
-    A1 = mean(A1(:,:,:),3);
-    %place it
-    quafig=zeros(dim,dim);
-    pl=round(([dim+1 dim+1]-size(A1))/2);
-    quafig(pl(1):end-pl(1)+dc1(img),pl(2):end-pl(2)+dc2(img))=A1;
-    if img==1
-  %     quafig(quafig>=255)=0;
-    end
-    %figure; imagesc(quafig);
-
-    %% display area / circle 
-    sz=floor(dim/2);
-    [x y] = meshgrid(-sz:sz,-sz:sz);
-    oc = NaN(size(x));
-    oc((x.^2+y.^2)<(dim/2)^2)=1;   % radius outrad, center at the origin
-    %% Gaussian smoothing kernel   
-    f=exp(-x.^2/(2*smooth^2)-y.^2/(2*smooth^2));
-    quafig=conv2(quafig,f,'same');
-    quafig=quafig./max(max(quafig));
-    %% rotate
-    figure;
-    mid=round(dim./2);
-    for t=1:length(th)
-        for i=1:size(quafig,1)
-            for j=1:size(quafig,2)
-
-                 x= (i-mid)*cos(th(t))+(j-mid)*sin(th(t));
-                 y=-(i-mid)*sin(th(t))+(j-mid)*cos(th(t));
-                 x=round(x)+mid;
-                 y=round(y)+mid;
-
-                 if (x>=1 && y>=1 && x<=size(quafig,2) && y<=size(quafig,1))
-                      romat(i,j,t,img)=quafig(x,y); % k degrees rotated image         
-                 end
-            end
-        end
-%        subplot(4,4,t);
-%        imagesc(romat(:,:,t,img));
-    end
-end
-
-combat=cat(3,romat(:,:,:,1),romat(:,:,:,2));
-tmpsizer=size(romat);
-combat=reshape(romat,[tmpsizer(1:2) tmpsizer(3)*tmpsizer(4)]);
-nth=[th th];
-%% distance (inner product)
-for i=1:length(nth)
-    for j=1:length(nth)
-        ith=reshape(combat(:,:,i).*oc,[dim*dim 1]);
-        jth=reshape(combat(:,:,j).*oc,[dim*dim 1]);
-        ith=ith(~isnan(ith));
-        jth=jth(~isnan(jth));
-        dist(i,j)=1-corr(ith,jth);
-        if i==j
-             dist(i,j)=0;
-             actdist(i,j)=0;
-        end
-        acdist(i,j)=abs(angdiff(nth(i),nth(j)));
-        if (i>length(th) & j<=length(th)) | (j>length(th) & i<=length(th))
-            acdist(i,j)=acdist(i,j)+1;
-            %dist(i,j)=dist(i,j);
-        end
-        %dist(i,j)=nansum(nansum(combat(:,:,i).*combat(:,:,j).*oc)); 
-    end
-end
-figure;
-dotsize=50
-
-% concrete
-ax1=subplot(3,3,1) 
-imagesc(dist);qlines(th) 
-colormap(ax1,'parula')
-
-ax3=subplot(3,3,4) 
-[Y,e] = cmdscale(dist,3);
-Y1=Y(1:length(th),:);
-c = linspace(1,64,length(Y1));
-scatter3(Y1(:,1),Y1(:,2),Y1(:,3),dotsize,c); hold on
-Y2=Y(length(th)+1:end,:);
-scatter3(Y2(:,1),Y2(:,2),Y2(:,3),dotsize,c,'filled');
-colormap(ax3,'hsv')
-
-% abstract continuous
-subplot(3,3,2) 
-imagesc(acdist); qlines(th); 
-[Y,e] = cmdscale(acdist,3);  
-ax4=subplot(3,3,5) 
-Y1=Y(1:length(th),:);
-scatter3(Y1(:,1),Y1(:,2),Y1(:,3),dotsize,c); hold on
-Y2=Y(length(th)+1:end,:);
-scatter3(Y2(:,1),Y2(:,2),Y2(:,3),dotsize,c,'filled');
-colormap(ax4,'hsv');
-%xlim([-2 2]); ylim([-2 2]); zlim([-2 2]);
-
-if length(th)==4
-    ax5=subplot(3,3,3); % abstract-idiosyncratic
-    %x=randn(1,xs); x=x-min(x); x=x./max(x);
-    xs=length(th);
-    x=[2 1.3 7 5]; x=x-min(x); x=x./max(x);
-    y=x+rand(1,xs).*0.3; y=y-min(y); y=y./max(y);
-    x=[x y];
-    rdm=NaN(length(x),length(x));
-    for i=1:length(x)
-        for j=1:length(x)
-            rdm(i,j)=abs(x(i)-x(j));
-            if abs(i-j)>xs
-                rdm(i,j)=rdm(i,j)+rand.*0.5;
-            end
-        end
-    end
-    tmp=squareform(rdm);
-    tmpreg=squareform(dist);
-    tmp=tmp-min(tmp); tmp=tmp./max(tmp);
-    [b,dev,stats]=glmfit(tmpreg,tmp);
-    tmp=stats.resid;
-    tmp=tmp-min(tmp); tmp=tmp./max(tmp);
-    rdm=squareform(tmp)
-    imagesc(rdm); axis off; hold on; qlines(th);
-    
-    ax6=subplot(3,3,6) 
-    [Y,e] = cmdscale(rdm,3); 
-    Y1=Y(1:length(th),:);
-    scatter3(Y1(:,1),Y1(:,2),Y1(:,3),dotsize,c); hold on
-    Y2=Y(length(th)+1:end,:);
-    scatter3(Y2(:,1),Y2(:,2),Y2(:,3),dotsize,c,'filled');
-    colormap(ax6,'hsv');
-    %xlim([-2 2]); ylim([-2 2]); zlim([-2 2]);
-end
-
-
-tmpreg1=squareform(dist);
-tmpreg2=squareform(acdist);
-
-% abstract discrete (tbd) 
-quadrlth=(length(th)^2-length(th))./2;
-rand(quadrlth,1);
-
-
-
-
-
-%%
-
-
-
-
-

+ 0 - 166
task/pixelsims/previousstuff/objori4real_eiffel_carfront.m

@@ -1,166 +0,0 @@
-clear all;
-
-images={'eiffel2';'carfront'}
-dc1=[1 1]
-dc2=[1 1];
-dim=131;
-smooth=1;
-
-
-th=linspace(-pi/4,pi/4,4); % angles
-th=fliplr(th);
-%th=th(1:end-1);
-romat=zeros(dim,dim,length(th),length(images));
-
-
-for img=1:length(images)
-
-    %get image
-    A1 = imread([images{img} '.bmp']);
-    A1 = mean(A1(:,:,:),3);
-    %place it
-    quafig=zeros(dim,dim);
-    pl=round(([dim+1 dim+1]-size(A1))/2);
-    quafig(pl(1):end-pl(1)+dc1(img),pl(2):end-pl(2)+dc2(img))=A1;
-   % if img==1
-       quafig(quafig>=230)=0;
-   % end
-    %figure; imagesc(quafig);
-
-    %% display area / circle 
-    sz=floor(dim/2);
-    [x y] = meshgrid(-sz:sz,-sz:sz);
-    oc = NaN(size(x));
-    oc((x.^2+y.^2)<(dim/2)^2)=1;   % radius outrad, center at the origin
-    %% Gaussian smoothing kernel   
-    f=exp(-x.^2/(2*smooth^2)-y.^2/(2*smooth^2));
-    quafig=conv2(quafig,f,'same');
-    quafig=quafig./max(max(quafig));
-    %% rotate
-    figure;
-    mid=round(dim./2);
-    for t=1:length(th)
-        for i=1:size(quafig,1)
-            for j=1:size(quafig,2)
-
-                 x= (i-mid)*cos(th(t))+(j-mid)*sin(th(t));
-                 y=-(i-mid)*sin(th(t))+(j-mid)*cos(th(t));
-                 x=round(x)+mid;
-                 y=round(y)+mid;
-
-                 if (x>=1 && y>=1 && x<=size(quafig,2) && y<=size(quafig,1))
-                      romat(i,j,t,img)=quafig(x,y); % k degrees rotated image         
-                 end
-            end
-        end
-        subplot(4,4,t);
-        imagesc(romat(:,:,t,img));
-    end
-end
-
-combat=cat(3,romat(:,:,:,1),romat(:,:,:,2));
-tmpsizer=size(romat);
-combat=reshape(romat,[tmpsizer(1:2) tmpsizer(3)*tmpsizer(4)]);
-nth=[th th];
-%% distance (inner product)
-for i=1:length(nth)
-    for j=1:length(nth)
-        ith=reshape(combat(:,:,i).*oc,[dim*dim 1]);
-        jth=reshape(combat(:,:,j).*oc,[dim*dim 1]);
-        ith=ith(~isnan(ith));
-        jth=jth(~isnan(jth));
-        dist(i,j)=1-corr(ith,jth);
-        if i==j
-             dist(i,j)=0;
-             actdist(i,j)=0;
-        end
-        acdist(i,j)=abs(angdiff(nth(i),nth(j)));
-        if (i>length(th) & j<=length(th)) | (j>length(th) & i<=length(th))
-            acdist(i,j)=acdist(i,j)+1;
-            %dist(i,j)=dist(i,j);
-        end
-        %dist(i,j)=nansum(nansum(combat(:,:,i).*combat(:,:,j).*oc)); 
-    end
-end
-figure;
-dotsize=50
-
-% concrete
-ax1=subplot(3,3,1) 
-imagesc(dist);qlines(th) 
-colormap(ax1,'parula')
-
-ax3=subplot(3,3,4) 
-[Y,e] = cmdscale(dist,3);
-Y1=Y(1:length(th),:);
-c = linspace(1,64,length(Y1));
-scatter3(Y1(:,1),Y1(:,2),Y1(:,3),dotsize,c); hold on
-Y2=Y(length(th)+1:end,:);
-scatter3(Y2(:,1),Y2(:,2),Y2(:,3),dotsize,c,'filled');
-colormap(ax3,'hsv')
-
-% abstract continuous
-subplot(3,3,2) 
-imagesc(acdist); qlines(th); 
-[Y,e] = cmdscale(acdist,3);  
-ax4=subplot(3,3,5) 
-Y1=Y(1:length(th),:);
-scatter3(Y1(:,1),Y1(:,2),Y1(:,3),dotsize,c); hold on
-Y2=Y(length(th)+1:end,:);
-scatter3(Y2(:,1),Y2(:,2),Y2(:,3),dotsize,c,'filled');
-colormap(ax4,'hsv');
-%xlim([-2 2]); ylim([-2 2]); zlim([-2 2]);
-
-if length(th)==4
-    ax5=subplot(3,3,3); % abstract-idiosyncratic
-    %x=randn(1,xs); x=x-min(x); x=x./max(x);
-    xs=length(th);
-    x=[2 1.3 7 5]; x=x-min(x); x=x./max(x);
-    y=x+rand(1,xs).*0.3; y=y-min(y); y=y./max(y);
-    x=[x y];
-    rdm=NaN(length(x),length(x));
-    for i=1:length(x)
-        for j=1:length(x)
-            rdm(i,j)=abs(x(i)-x(j));
-            if abs(i-j)>xs
-                rdm(i,j)=rdm(i,j)+rand.*0.5;
-            end
-        end
-    end
-    tmp=squareform(rdm);
-    tmpreg=squareform(dist);
-    tmp=tmp-min(tmp); tmp=tmp./max(tmp);
-    [b,dev,stats]=glmfit(tmpreg,tmp);
-    tmp=stats.resid;
-    tmp=tmp-min(tmp); tmp=tmp./max(tmp);
-    rdm=squareform(tmp)
-    imagesc(rdm); axis off; hold on; qlines(th);
-    
-    ax6=subplot(3,3,6) 
-    [Y,e] = cmdscale(rdm,3); 
-    Y1=Y(1:length(th),:);
-    scatter3(Y1(:,1),Y1(:,2),Y1(:,3),dotsize,c); hold on
-    Y2=Y(length(th)+1:end,:);
-    scatter3(Y2(:,1),Y2(:,2),Y2(:,3),dotsize,c,'filled');
-    colormap(ax6,'hsv');
-    %xlim([-2 2]); ylim([-2 2]); zlim([-2 2]);
-end
-
-
-tmpreg1=squareform(dist);
-tmpreg2=squareform(acdist);
-
-% abstract discrete (tbd) 
-quadrlth=(length(th)^2-length(th))./2;
-rand(quadrlth,1);
-
-
-
-
-
-%%
-
-
-
-
-

+ 0 - 204
task/pixelsims/previousstuff/objori4real_eiffel_carfront_200114.m

@@ -1,204 +0,0 @@
-clear all;
-
-images={'eiffel2';'carfront'}
-dc1=[1 1]
-dc2=[1 1];
-dim=131;
-smooth=1;
-
-
-th=linspace(-pi,pi,17); % angles
-th=fliplr(th);
-th=th(1:end-1);
-%degax=rad2deg([th th]); % for plots
-romat=zeros(dim,dim,length(th),length(images));
-
-
-for img=1:length(images)
-
-    %get image
-    A1 = imread([images{img} '.bmp']);
-    A1 = mean(A1(:,:,:),3);
-    %place it
-    quafig=zeros(dim,dim);
-    pl=round(([dim+1 dim+1]-size(A1))/2);
-    quafig(pl(1):end-pl(1)+dc1(img),pl(2):end-pl(2)+dc2(img))=A1;
-   % if img==1
-       quafig(quafig>=230)=0;
-   % end
-    %figure; imagesc(quafig);
-
-    %% display area / circle 
-    sz=floor(dim/2);
-    [x y] = meshgrid(-sz:sz,-sz:sz);
-    oc = NaN(size(x));
-    oc((x.^2+y.^2)<(dim/2)^2)=1;   % radius outrad, center at the origin
-    %% Gaussian smoothing kernel   
-    f=exp(-x.^2/(2*smooth^2)-y.^2/(2*smooth^2));
-    quafig=conv2(quafig,f,'same');
-    quafig=quafig./max(max(quafig));
-    %% rotate
-    figure;
-    mid=round(dim./2);
-    for t=1:length(th)
-        for i=1:size(quafig,1)
-            for j=1:size(quafig,2)
-
-                 x= (i-mid)*cos(th(t))+(j-mid)*sin(th(t));
-                 y=-(i-mid)*sin(th(t))+(j-mid)*cos(th(t));
-                 x=round(x)+mid;
-                 y=round(y)+mid;
-
-                 if (x>=1 && y>=1 && x<=size(quafig,2) && y<=size(quafig,1))
-                      romat(i,j,t,img)=quafig(x,y); % k degrees rotated image         
-                 end
-            end
-        end
-%         subplot(4,4,t);
-%         imagesc(romat(:,:,t,img));
-    end
-end
-
-combat=cat(3,romat(:,:,:,1),romat(:,:,:,2));
-tmpsizer=size(romat);
-combat=reshape(romat,[tmpsizer(1:2) tmpsizer(3)*tmpsizer(4)]);
-nth=[th th];
-%% distance (inner product)
-for i=1:length(nth)
-    for j=1:length(nth)
-        ith=reshape(combat(:,:,i).*oc,[dim*dim 1]);
-        jth=reshape(combat(:,:,j).*oc,[dim*dim 1]);
-        ith=ith(~isnan(ith));
-        jth=jth(~isnan(jth));
-        dist(i,j)=1-corr(ith,jth);
-        if i==j
-             dist(i,j)=0;
-             acdist(i,j)=0;
-        end
-        acdist(i,j)=abs(angdiff(nth(i),nth(j)));
-        if (i>length(th) & j<=length(th)) | (j>length(th) & i<=length(th))
-            %acdist(i,j)=0 ; acdist(i,j);
-            dist(i,j)=dist(i,j)+0.2;
-        end
-        %dist(i,j)=nansum(nansum(combat(:,:,i).*combat(:,:,j).*oc)); 
-    end
-end
-figure;
-dotsize=50
-
-% concrete
-ax1=subplot(2,4,1) 
-imagesc(dist);axis off; hold on; qlines(th) 
-colormap(ax1,'parula')
-
-% ax3=subplot(2,4,6) 
-% [Y,e] = cmdscale(dist,3);
-% Y1=Y(1:length(th),:);
-% c = linspace(1,64,length(Y1));
-% scatter3(Y1(:,1),Y1(:,2),Y1(:,3),dotsize,c); hold on
-% Y2=Y(length(th)+1:end,:);
-% scatter3(Y2(:,1),Y2(:,2),Y2(:,3),dotsize,c,'filled');
-% colormap(ax3,'hsv')
-
-% abstract continuous
-subplot(2,4,2) 
-imagesc(acdist); axis off; hold on; qlines(th); 
-% [Y,e] = cmdscale(acdist,3);  
-% ax4=subplot(4,4,5) 
-% Y1=Y(1:length(th),:);
-% scatter3(Y1(:,1),Y1(:,2),Y1(:,3),dotsize,c); hold on
-% Y2=Y(length(th)+1:end,:);
-% scatter3(Y2(:,1),Y2(:,2),Y2(:,3),dotsize,c,'filled');
-% colormap(ax4,'hsv');
-%xlim([-2 2]); ylim([-2 2]); zlim([-2 2]);
-
-% if length(th)==4
-%     ax5=subplot(4,4,3); % abstract-idiosyncratic
-%     %x=randn(1,xs); x=x-min(x); x=x./max(x);
-%     xs=length(th);
-%     x=[2 1.3 7 5]; x=x-min(x); x=x./max(x);
-%     y=x+rand(1,xs).*0.3; y=y-min(y); y=y./max(y);
-%     x=[x y];
-%     rdm=NaN(length(x),length(x));
-%     for i=1:length(x)
-%         for j=1:length(x)
-%             rdm(i,j)=abs(x(i)-x(j));
-%             if abs(i-j)>xs
-%                 rdm(i,j)=rdm(i,j)+rand.*0.5;
-%             end
-%         end
-%     end
-%     tmp=squareform(rdm);
-%     tmpreg=squareform(dist);
-%     tmp=tmp-min(tmp); tmp=tmp./max(tmp);
-%     [b,dev,stats]=glmfit(tmpreg,tmp);
-%     tmp=stats.resid;
-%     tmp=tmp-min(tmp); tmp=tmp./max(tmp);
-%     rdm=squareform(tmp)
-%     imagesc(rdm); axis off; hold on; qlines(th);
-%     
-%     ax6=subplot(4,4,6) 
-%     [Y,e] = cmdscale(rdm,3); 
-%     Y1=Y(1:length(th),:);
-%     scatter3(Y1(:,1),Y1(:,2),Y1(:,3),dotsize,c); hold on
-%     Y2=Y(length(th)+1:end,:);
-%     scatter3(Y2(:,1),Y2(:,2),Y2(:,3),dotsize,c,'filled');
-%     colormap(ax6,'hsv');
-%     %xlim([-2 2]); ylim([-2 2]); zlim([-2 2]);
-% end
-
-
-tmpreg1=squareform(dist);
-tmpreg2=squareform(acdist);
-[Rho p]=corr(tmpreg1',tmpreg2');
-
-% abstract discrete (tbd) 
-quadrlth=(length(th)^2-length(th))./2;
-rand(quadrlth,1);
-
-
-X=[]; Y=[]; noiser=0.1
-for i=1:length(th)
-    a=rad2deg(th(i));
-    X(i,1)=double(abs(a)<90)+randn*noiser; % left/right
-    X(i,2)=double(a<0)+randn.*noiser; % upside-down
-   % X(i,3)=abs(angdiff(th(i).*4,0))./pi+randn*noiser; % cardinal/diagonal
-    X(i,3)=abs(angdiff(th(i).*2,0))./pi+randn*noiser; % standing (hanging) / lying on side
-    Y(i,1)=double(abs(a)<90)+randn*noiser; % left/right
-    Y(i,2)=double(a<0)+randn*noiser; % upside-down
-    %Y(i,3)=abs(angdiff(th(i).*4,0))./pi+randn*noiser; % cardinal/diagonal
-    Y(i,3)=abs(angdiff(th(i).*2,0))./pi+randn*noiser; % standing (hanging) / lying on side
-    
-    
-    
-end
-X=[X; Y];
-d=pdist(X);
-
-[b,dev,stats] = glmfit([tmpreg1' tmpreg2'],d');
-d=stats.resid;
-d=d-min(min(d));
-d=d./max(max(d));
-
-rdm=squareform(d);
-subplot(2,4,3); imagesc(rdm); axis off; hold on; qlines(th);
-% ax6=subplot(4,4,6) 
-% [Y,e] = cmdscale(rdm,3); 
-% Y1=Y(1:length(th),:);
-% scatter3(Y1(:,1),Y1(:,2),Y1(:,3),dotsize,c); hold on
-% Y2=Y(length(th)+1:end,:);
-% scatter3(Y2(:,1),Y2(:,2),Y2(:,3),dotsize,c,'filled');
-% colormap(ax6,'hsv');
-
-% subplot(2,4,9); imagesc(1); colorbar;
-
-
-% %%
-% % alltogether
-% allX=[X.*2+0.5 cmdscale(acdist).*2 cmdscale(dist)];
-% d=squareform(pdist(allX));
-% subplot(2,4,9);imagesc(d);
-
-
-
-

+ 0 - 166
task/pixelsims/previousstuff/objori4real_num.m

@@ -1,166 +0,0 @@
-clear all;
-
-images={'3';'4'}
-dc1=[1 1];
-dc2=[1 1]
-dim=61;
-smooth=1;
-
-
-th=linspace(-pi,pi,128); % angles
-th=fliplr(th);
-%th=th(1:end-1);
-romat=zeros(dim,dim,length(th),length(images));
-
-m=20; % margin
-for img=1:length(images)
-
-    %get image
-    A1 = imread([images{img} '.bmp']);
-    A1 = mean(A1(m:end-m,m:end-m,:),3);
-    %place it
-    quafig=zeros(dim,dim);
-    pl=round(([dim+1 dim+1]-size(A1))/2);
-    quafig(pl(1):end-pl(1)+dc1(img),pl(2):end-pl(2)+dc2(img))=A1;
-    if img==1
-  %     quafig(quafig>=255)=0;
-    end
-    %figure; imagesc(quafig);
-
-    %% display area / circle 
-    sz=floor(dim/2);
-    [x y] = meshgrid(-sz:sz,-sz:sz);
-    oc = NaN(size(x));
-    oc((x.^2+y.^2)<(dim/2)^2)=1;   % radius outrad, center at the origin
-    %% Gaussian smoothing kernel   
-    f=exp(-x.^2/(2*smooth^2)-y.^2/(2*smooth^2));
-    quafig=conv2(quafig,f,'same');
-    quafig=quafig./max(max(quafig));
-    %% rotate
-    figure;
-    mid=round(dim./2);
-    for t=1:length(th)
-        for i=1:size(quafig,1)
-            for j=1:size(quafig,2)
-
-                 x= (i-mid)*cos(th(t))+(j-mid)*sin(th(t));
-                 y=-(i-mid)*sin(th(t))+(j-mid)*cos(th(t));
-                 x=round(x)+mid;
-                 y=round(y)+mid;
-
-                 if (x>=1 && y>=1 && x<=size(quafig,2) && y<=size(quafig,1))
-                      romat(i,j,t,img)=quafig(x,y); % k degrees rotated image         
-                 end
-            end
-        end
-%        subplot(4,4,t);
-%        imagesc(romat(:,:,t,img));
-    end
-end
-
-combat=cat(3,romat(:,:,:,1),romat(:,:,:,2));
-tmpsizer=size(romat);
-combat=reshape(romat,[tmpsizer(1:2) tmpsizer(3)*tmpsizer(4)]);
-nth=[th th];
-%% distance (inner product)
-for i=1:length(nth)
-    for j=1:length(nth)
-        ith=reshape(combat(:,:,i).*oc,[dim*dim 1]);
-        jth=reshape(combat(:,:,j).*oc,[dim*dim 1]);
-        ith=ith(~isnan(ith));
-        jth=jth(~isnan(jth));
-        dist(i,j)=1-corr(ith,jth);
-        if i==j
-             dist(i,j)=0;
-             actdist(i,j)=0;
-        end
-        acdist(i,j)=abs(angdiff(nth(i),nth(j)));
-        if (i>length(th) & j<=length(th)) | (j>length(th) & i<=length(th))
-            acdist(i,j)=acdist(i,j)+1;
-            %dist(i,j)=dist(i,j);
-        end
-        %dist(i,j)=nansum(nansum(combat(:,:,i).*combat(:,:,j).*oc)); 
-    end
-end
-figure;
-dotsize=50
-
-% concrete
-ax1=subplot(3,3,1) 
-imagesc(dist);qlines(th) 
-colormap(ax1,'parula')
-
-ax3=subplot(3,3,4) 
-[Y,e] = cmdscale(dist,3);
-Y1=Y(1:length(th),:);
-c = linspace(1,64,length(Y1));
-scatter3(Y1(:,1),Y1(:,2),Y1(:,3),dotsize,c); hold on
-Y2=Y(length(th)+1:end,:);
-scatter3(Y2(:,1),Y2(:,2),Y2(:,3),dotsize,c,'filled');
-colormap(ax3,'hsv')
-
-% abstract continuous
-subplot(3,3,2) 
-imagesc(acdist); qlines(th); 
-[Y,e] = cmdscale(acdist,3);  
-ax4=subplot(3,3,5) 
-Y1=Y(1:length(th),:);
-scatter3(Y1(:,1),Y1(:,2),Y1(:,3),dotsize,c); hold on
-Y2=Y(length(th)+1:end,:);
-scatter3(Y2(:,1),Y2(:,2),Y2(:,3),dotsize,c,'filled');
-colormap(ax4,'hsv');
-%xlim([-2 2]); ylim([-2 2]); zlim([-2 2]);
-
-if length(th)==4
-    ax5=subplot(3,3,3); % abstract-idiosyncratic
-    %x=randn(1,xs); x=x-min(x); x=x./max(x);
-    xs=length(th);
-    x=[2 1.3 7 5]; x=x-min(x); x=x./max(x);
-    y=x+rand(1,xs).*0.3; y=y-min(y); y=y./max(y);
-    x=[x y];
-    rdm=NaN(length(x),length(x));
-    for i=1:length(x)
-        for j=1:length(x)
-            rdm(i,j)=abs(x(i)-x(j));
-            if abs(i-j)>xs
-                rdm(i,j)=rdm(i,j)+rand.*0.5;
-            end
-        end
-    end
-    tmp=squareform(rdm);
-    tmpreg=squareform(dist);
-    tmp=tmp-min(tmp); tmp=tmp./max(tmp);
-    [b,dev,stats]=glmfit(tmpreg,tmp);
-    tmp=stats.resid;
-    tmp=tmp-min(tmp); tmp=tmp./max(tmp);
-    rdm=squareform(tmp)
-    imagesc(rdm); axis off; hold on; qlines(th);
-    
-    ax6=subplot(3,3,6) 
-    [Y,e] = cmdscale(rdm,3); 
-    Y1=Y(1:length(th),:);
-    scatter3(Y1(:,1),Y1(:,2),Y1(:,3),dotsize,c); hold on
-    Y2=Y(length(th)+1:end,:);
-    scatter3(Y2(:,1),Y2(:,2),Y2(:,3),dotsize,c,'filled');
-    colormap(ax6,'hsv');
-    %xlim([-2 2]); ylim([-2 2]); zlim([-2 2]);
-end
-
-
-tmpreg1=squareform(dist);
-tmpreg2=squareform(acdist);
-
-% abstract discrete (tbd) 
-quadrlth=(length(th)^2-length(th))./2;
-rand(quadrlth,1);
-
-
-
-
-
-%%
-
-
-
-
-

+ 0 - 165
task/pixelsims/previousstuff/objori4real_spec.m

@@ -1,165 +0,0 @@
-clear all;
-
-images={'car';'pisa'}
-dc=[1 0];
-dim=131;
-smooth=1;
-
-
-th=linspace(-pi,pi,64); % angles
-th=fliplr(th);
-%th=th(1:end-1);
-romat=zeros(dim,dim,length(th),length(images));
-
-
-for img=1:length(images)
-
-    %get image
-    A1 = imread([images{img} '.bmp']);
-    A1 = mean(A1(:,:,:),3);
-    %place it
-    quafig=zeros(dim,dim);
-    pl=round(([dim+1 dim+1]-size(A1))/2);
-    quafig(pl(1):end-pl(1),pl(2):end-pl(2)+dc(img))=A1;
-    if img==1
-  %     quafig(quafig>=255)=0;
-    end
-    %figure; imagesc(quafig);
-
-    %% display area / circle 
-    sz=floor(dim/2);
-    [x y] = meshgrid(-sz:sz,-sz:sz);
-    oc = NaN(size(x));
-    oc((x.^2+y.^2)<(dim/2)^2)=1;   % radius outrad, center at the origin
-    %% Gaussian smoothing kernel   
-    f=exp(-x.^2/(2*smooth^2)-y.^2/(2*smooth^2));
-    quafig=conv2(quafig,f,'same');
-    quafig=quafig./max(max(quafig));
-    %% rotate
-    figure;
-    mid=round(dim./2);
-    for t=1:length(th)
-        for i=1:size(quafig,1)
-            for j=1:size(quafig,2)
-
-                 x= (i-mid)*cos(th(t))+(j-mid)*sin(th(t));
-                 y=-(i-mid)*sin(th(t))+(j-mid)*cos(th(t));
-                 x=round(x)+mid;
-                 y=round(y)+mid;
-
-                 if (x>=1 && y>=1 && x<=size(quafig,2) && y<=size(quafig,1))
-                      romat(i,j,t,img)=quafig(x,y); % k degrees rotated image         
-                 end
-            end
-        end
-%        subplot(4,4,t);
-%        imagesc(romat(:,:,t,img));
-    end
-end
-
-combat=cat(3,romat(:,:,:,1),romat(:,:,:,2));
-tmpsizer=size(romat);
-combat=reshape(romat,[tmpsizer(1:2) tmpsizer(3)*tmpsizer(4)]);
-nth=[th th];
-%% distance (inner product)
-for i=1:length(nth)
-    for j=1:length(nth)
-        ith=reshape(combat(:,:,i).*oc,[dim*dim 1]);
-        jth=reshape(combat(:,:,j).*oc,[dim*dim 1]);
-        ith=ith(~isnan(ith));
-        jth=jth(~isnan(jth));
-        dist(i,j)=1-corr(ith,jth);
-        if i==j
-             dist(i,j)=0;
-             actdist(i,j)=0;
-        end
-        acdist(i,j)=abs(angdiff(nth(i),nth(j)));
-        if (i>length(th) & j<=length(th)) | (j>length(th) & i<=length(th))
-            acdist(i,j)=acdist(i,j)+1;
-            %dist(i,j)=dist(i,j);
-        end
-        %dist(i,j)=nansum(nansum(combat(:,:,i).*combat(:,:,j).*oc)); 
-    end
-end
-figure;
-dotsize=50
-
-% concrete
-ax1=subplot(3,3,1) 
-imagesc(dist);qlines(th) 
-colormap(ax1,'parula')
-
-ax3=subplot(3,3,4) 
-[Y,e] = cmdscale(dist,3);
-Y1=Y(1:length(th),:);
-c = linspace(1,64,length(Y1));
-scatter3(Y1(:,1),Y1(:,2),Y1(:,3),dotsize,c); hold on
-Y2=Y(length(th)+1:end,:);
-scatter3(Y2(:,1),Y2(:,2),Y2(:,3),dotsize,c,'filled');
-colormap(ax3,'hsv')
-
-% abstract continuous
-subplot(3,3,2) 
-imagesc(acdist); qlines(th); 
-[Y,e] = cmdscale(acdist,3);  
-ax4=subplot(3,3,5) 
-Y1=Y(1:length(th),:);
-scatter3(Y1(:,1),Y1(:,2),Y1(:,3),dotsize,c); hold on
-Y2=Y(length(th)+1:end,:);
-scatter3(Y2(:,1),Y2(:,2),Y2(:,3),dotsize,c,'filled');
-colormap(ax4,'hsv');
-%xlim([-2 2]); ylim([-2 2]); zlim([-2 2]);
-
-if length(th)==4
-    ax5=subplot(3,3,3); % abstract-idiosyncratic
-    %x=randn(1,xs); x=x-min(x); x=x./max(x);
-    xs=length(th);
-    x=[2 1.3 7 5]; x=x-min(x); x=x./max(x);
-    y=x+rand(1,xs).*0.3; y=y-min(y); y=y./max(y);
-    x=[x y];
-    rdm=NaN(length(x),length(x));
-    for i=1:length(x)
-        for j=1:length(x)
-            rdm(i,j)=abs(x(i)-x(j));
-            if abs(i-j)>xs
-                rdm(i,j)=rdm(i,j)+rand.*0.5;
-            end
-        end
-    end
-    tmp=squareform(rdm);
-    tmpreg=squareform(dist);
-    tmp=tmp-min(tmp); tmp=tmp./max(tmp);
-    [b,dev,stats]=glmfit(tmpreg,tmp);
-    tmp=stats.resid;
-    tmp=tmp-min(tmp); tmp=tmp./max(tmp);
-    rdm=squareform(tmp)
-    imagesc(rdm); axis off; hold on; qlines(th);
-    
-    ax6=subplot(3,3,6) 
-    [Y,e] = cmdscale(rdm,3); 
-    Y1=Y(1:length(th),:);
-    scatter3(Y1(:,1),Y1(:,2),Y1(:,3),dotsize,c); hold on
-    Y2=Y(length(th)+1:end,:);
-    scatter3(Y2(:,1),Y2(:,2),Y2(:,3),dotsize,c,'filled');
-    colormap(ax6,'hsv');
-    %xlim([-2 2]); ylim([-2 2]); zlim([-2 2]);
-end
-
-
-tmpreg1=squareform(dist);
-tmpreg2=squareform(acdist);
-
-% abstract discrete (tbd) 
-quadrlth=(length(th)^2-length(th))./2;
-rand(quadrlth,1);
-
-
-
-
-
-%%
-
-
-
-
-

BIN
task/pixelsims/previousstuff/pisa.bmp


+ 0 - 11
task/pixelsims/previousstuff/qlines.m

@@ -1,11 +0,0 @@
-function qlines(th)
-    fl=2*length(th)+1;
-    hl=fl/2;
-    hold on;
-    plot([0 fl],[hl hl],'k-');
-    plot([0 fl],[0 0],'k-');
-    plot([0 fl],[fl fl],'k-');
-    plot([hl hl],[0 fl],'k-');
-    plot([0 0],[0 fl],'k-');
-    plot([fl fl],[0 fl],'k-');
-end%%

+ 0 - 80
task/pixelsims/previousstuff/rdm_mds.m

@@ -1,80 +0,0 @@
-%x=[1 2 3 4  1.5 2.5 3.5 4.5  0.5 1.5 2.5 3.5];
-x=[linspace(0,1,4) linspace(0,1,4)];
-xs=length(x)./2;
-
-figure; 
-subplot(4,6,3)% fully abstract 
-rdm=NaN(length(x),length(x));
-for i=1:length(x)
-    for j=1:length(x)
-        rdm(i,j)=abs(x(i)-x(j))%+0.1.*randn;
-    end
-end
-imagesc(rdm); axis off; hold on; qlines
-
-subplot(4,6,2) % half absract
-for i=1:xs
-    for j=1:xs
-        rdm(i+xs,j)=(rdm(i+xs,j)-0.5).*0.5+0.5%.*randn;
-        rdm(i,j+xs)=(rdm(i,j+xs)-0.5).*0.5+0.5%.*randn;
-    end
-end
-imagesc(rdm); axis off; hold on; qlines
-
-subplot(4,6,1) % Concrete
-for i=1:xs
-    for j=1:xs
-        rdm(i+xs,j)=0.5%.*randn;
-        rdm(i,j+xs)=0.5%.*randn;
-    end
-end
-imagesc(rdm); axis off; hold on; qlines
-
-
-subplot(4,6,6); % abstract-idiosyncratic
-x=randn(1,xs); x=x-min(x); x=x./max(x);
-x=[x x];
-rdm=NaN(length(x),length(x));
-for i=1:length(x)
-    for j=1:length(x)
-        rdm(i,j)=abs(x(i)-x(j));
-    end
-end
-imagesc(rdm); axis off; hold on; qlines;
-
-subplot(4,6,5); % half-abstract-idiosyncratic
-for i=1:xs
-    for j=1:xs
-        rdm(i+xs,j)=0.5%.*randn;
-        rdm(i,j+xs)=0.5%.*randn;
-    end
-end
-imagesc(rdm); axis off; hold on; qlines;
-
-%%
-
-
-function qlines
-    plot([0 9],[4.5 4.5],'k-');
-    plot([0 9],[0 0],'k-');
-    plot([0 9],[9 9],'k-');
-    plot([4.5 4.5],[0 9],'k-');
-    plot([0 0],[0 9],'k-');
-    plot([9 9],[0 9],'k-');
-end
-
-%% dump
-
-% rdm=NaN(4,4);
-% for i=1:4
-%     for j=1:4
-%         rdm(i,j)=abs(x(i)-x(j));%+0.1.*randn;
-%     end
-% end
-% subplot(4,4,1) 
-% imagesc(rdm); axis off; 
-
-
-
-
-

+ 0 - 101
task/pixelsims/previousstuff/rdm_mds_191203.m

@@ -1,101 +0,0 @@
-%x=[1 2 3 4  1.5 2.5 3.5 4.5  0.5 1.5 2.5 3.5];
-x=[linspace(0,1,4) linspace(0,1,4)];
-xs=length(x)./2;
-
-figure; 
-subplot(3,4,2)% abstract-continous 
-rdm=NaN(length(x),length(x));
-for i=1:length(x)
-    for j=1:length(x)
-        rdm(i,j)=abs(x(i)-x(j));%+0.1.*randn;
-    end
-end
-imagesc(rdm); axis off; hold on; qlines
-tmpreg=squareform(rdm);
-
-% subplot(4,6,2) % half absract
-% for i=1:xs
-%     for j=1:xs
-%         rdm(i+xs,j)=(rdm(i+xs,j)-0.5).*0.5+0.5%.*randn;
-%         rdm(i,j+xs)=(rdm(i,j+xs)-0.5).*0.5+0.5%.*randn;
-%     end
-% end
-% imagesc(rdm); axis off; hold on; qlines
-
- 
-subplot(3,4,1)% concrete
-rdm=NaN(length(x),length(x));
-for i=1:length(x)
-    for j=1:length(x)
-        rdm(i,j)=abs(x(i)-x(j));%+0.1.*randn;
-    end
-end
-imagesc(rdm); axis off; hold on; qlines
-for i=1:xs
-    for j=1:xs
-        rdm(i+xs,j)=0.5;%.*randn;
-        rdm(i,j+xs)=0.5;%.*randn;
-    end
-end
-imagesc(rdm); axis off; hold on; qlines
-
-
-subplot(3,4,3); % abstract-idiosyncratic
-%x=randn(1,xs); x=x-min(x); x=x./max(x);
-x=[2 1.3 7 5]; x=x-min(x); x=x./max(x);
-
-y=x+rand(1,xs).*0.3; y=y-min(y); y=y./max(y);
-x=[x y];
-rdm=NaN(length(x),length(x));
-for i=1:length(x)
-    for j=1:length(x)
-        rdm(i,j)=abs(x(i)-x(j));
-        if abs(i-j)>xs
-            rdm(i,j)=rdm(i,j)+rand.*0.5;
-        end
-    end
-end
-tmp=squareform(rdm);
-tmp=tmp-min(tmp); tmp=tmp./max(tmp);
-[b,dev,stats]=glmfit(tmpreg,tmp);
-tmp=stats.resid;
-tmp=tmp-min(tmp); tmp=tmp./max(tmp);
-rdm=squareform(tmp)
-imagesc(rdm); axis off; hold on; qlines;
-
-% subplot(4,6,5); % half-abstract-idiosyncratic
-% for i=1:xs
-%     for j=1:xs
-%         rdm(i+xs,j)=0.5%.*randn;
-%         rdm(i,j+xs)=0.5%.*randn;
-%     end
-% end
-% imagesc(rdm); axis off; hold on; qlines;
-
-%%
-
-
-function qlines
-    plot([0 9],[4.5 4.5],'k-');
-    plot([0 9],[0 0],'k-');
-    plot([0 9],[9 9],'k-');
-    plot([4.5 4.5],[0 9],'k-');
-    plot([0 0],[0 9],'k-');
-    plot([9 9],[0 9],'k-');
-end
-
-%% dump
-
-% rdm=NaN(4,4);
-% for i=1:4
-%     for j=1:4
-%         rdm(i,j)=abs(x(i)-x(j));%+0.1.*randn;
-%     end
-% end
-% subplot(4,4,1) 
-% imagesc(rdm); axis off; 
-
-
-
-
-

+ 0 - 68
task/pixelsims/previousstuff/rdm_sim.m

@@ -1,68 +0,0 @@
-%x=[1 2 3 4  1.5 2.5 3.5 4.5  0.5 1.5 2.5 3.5];
-x=[linspace(0,1,4) linspace(0,1,4)];
-
-figure; % abstract 
-
-rdm=NaN(4,4);
-for i=1:4
-    for j=1:4
-        rdm(i,j)=abs(x(i)-x(j));%+0.1.*randn;
-    end
-end
-subplot(4,4,1) 
-imagesc(rdm); axis off; 
-
-rdm=NaN(length(x),length(x));
-for i=1:length(x)
-    for j=1:length(x)
-        rdm(i,j)=abs(x(i)-x(j))%+0.1.*randn;
-    end
-end
-subplot(4,4,2) 
-imagesc(rdm); axis off; hold on; qlines
-
-%colormap('hot')
-
-subplot(4,4,3) % Concrete
-for i=1:4
-    for j=1:4
-        rdm(i+4,j)=-abs(x(i)-x(j+4))+1%.*randn;
-        rdm(i,j+4)=-abs(x(i+4)-x(j))+1%.*randn;
-    end
-end
-imagesc(rdm); axis off; hold on; qlines
-
-
-x=randn(1,4) % idiosyncratic
-x=[x x];
-rdm=NaN(length(x),length(x));
-for i=1:length(x)
-    for j=1:length(x)
-        rdm(i,j)=abs(x(i)-x(j))+0.2.*randn;
-    end
-end
-subplot(4,4,4) 
-imagesc(rdm); axis off; hold on; qlines;
-
-subplot(3,3,4) 
-rdm=zeros(length(x),length(x));
-rdm(1:4,1:4)=1;
-rdm(5:8,5:8)=1
-imagesc(rdm); axis off; hold on; qlines
-
-
-function qlines
-    plot([0 9],[4.5 4.5],'k-');
-    plot([0 9],[0 0],'k-');
-    plot([0 9],[9 9],'k-');
-    plot([4.5 4.5],[0 9],'k-');
-    plot([0 0],[0 9],'k-');
-    plot([9 9],[0 9],'k-');
-end
-
-
-
-
-
-
-