Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: combine image parts
Date: Sun, 26 Jul 2009 15:02:03 +0000 (UTC)
Organization: Universit&#228;tsSpital Z&#252;rich
Lines: 40
Message-ID: <h4hr5a$7vl$1@fred.mathworks.com>
References: <h4bv2g$ac0$1@fred.mathworks.com> <701f52c0-8ab6-4b0a-ac88-7dec944aa8ce@n11g2000yqb.googlegroups.com> <h4fgav$k3q$1@fred.mathworks.com> <h4fi8p$msr$1@fred.mathworks.com> <h4fjv5$d7q$1@fred.mathworks.com> <h4hmf9$6v3$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1248620523 8181 172.30.248.37 (26 Jul 2009 15:02:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sun, 26 Jul 2009 15:02:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 11
Xref: news.mathworks.com comp.soft-sys.matlab:558409


"Brian J."
> What must I do?

one of the solutions is outlined below
- this requires the image proc tbx(!)...
- use MONTAGE on delimiter enhanced subimages...

     n=64;
     m=16;
     img=reshape(1:n*n,[n,n]);     % <- the big image...
     img=img+5000*rand(size(img));     % <- ...with a bit of noise...
     ix=1:m;     % <- the index template...
     ni=n/m;     % <- add error check: must be INT...
     simg=zeros(m+1,m+1,1,ni*ni);
     del=-100*ones(1,m);
     k=0;
% create 4D subimages with dels...
for  i=1:ni
     xv=(i-1)*m+ix;
for  j=1:ni
     k=k+1;
     yv=(j-1)*m+ix;
% - add del...
     simg(:,:,1,k)=[img(xv,yv),del.';del,-100];
end
end
% - adjust colormap...
     simg=255*simg./max(img(:));
     simg(simg<0)=-1;
     cmap=[
          [1,1,0]     % <- del
          gray(255)
     ];
% - set IMSHOW prop...
     imod=iptgetpref('ImshowInitialMagnification');
     iptsetpref('ImshowInitialMagnification','fit');
     montage(simg,cmap,'size',[ni,ni]);
     iptsetpref('ImshowInitialMagnification',imod);

us