COMPGROUPS.NET | Search | Post Question | Groups | Stream | About | Register

### Circshift error

• Email
• Follow

I am currently working on 3D reconstruction of multiple images from a optical bioimaging technique called Full-field Optical Coherence Tomography. I am currently trying to reconstruct a 3D model from 25 images (frame1, frame2, .... , frame25)

Hence I am currently modifying Doug Hull's 3D Solid Reconstruction of Planar Slices matlab code as his code reconstructs only two planar slices, one base_image and the move_image.

I am having a problem at one area involving the circshift function.

Basically i have read in the images as follows;

for i = startFrame:endFrame

base_filename = 'frame1.tif';                                     %Filename of nonmoving image
move_filename = [filebase, num2str(i, '%3d'), '.tif'];
move_image(:,:,:,i) = imread(move_filename);    %Filename of image that will move to the base image

end

The problem now occurs here. The error message is "Invalid Shift Type: Shift must be a finite, nonsparse, real integer vector. "

for i = startFrame:endFrame

move_image(:,:,i)= circshift(move_image(:,:,i), [move_delta_rows(:,:,i), move_delta_cols(:,:,i)]);
move_delta_cols(:,:,i)]);

end;

For the base image, it seems to work fine.

base_image = circshift(base_image , [base_delta_rows, base_delta_cols]);

Thank you for any help rendered.

Anitha

 0
Reply Anitha 12/15/2010 6:50:13 AM

See related articles to this posting

On 15/12/10 12:50 AM, Anitha wrote:

> The problem now occurs here. The error message is "Invalid Shift Type:
> Shift must be a finite, nonsparse, real integer vector. "
>
> for i = startFrame:endFrame
>
> move_image(:,:,i)= circshift(move_image(:,:,i), [move_delta_rows(:,:,i), move_delta_cols(:,:,i)]);

Check your code again. Is

[move_delta_rows(:,:,i), move_delta_cols(:,:,i)]

finite, non-sparse, real, integer-valued, and a _vector_ ?

 0
Reply Walter 12/15/2010 7:09:59 AM

Glad to see this code is still useful.  I agree with the above suggestion.  If you are still having problems, please contact me.

Doug

 0
Reply Doug 12/15/2010 4:36:20 PM

I am still not sure how I can change it to a vector and non-sparse. It is a 1 by 1 by 25 double array now. So is there any other function I should or could use in place of circshift then? Sorry for the trouble, as I am still quite new to Matlab.

for i = startFrame:endFrame

move_bw_plane_of_interest(:,:,i) = im2bw(move_image(:,:,i), graythresh(move_image(:,:,i)));
move_plane_of_interest_segmented(:,:,i) = bwmorph(move_bw_plane_of_interest(:,:,i), 'open');
move_binary_mask(:,:,i) = imfill(move_plane_of_interest_segmented(:,:,i), 'holes');

move_centroid_row(:,:,i) = round(move_properties(:,:,i).Centroid(2));
move_centroid_col(:,:,i) = round(move_properties(:,:,i).Centroid(1));

move_image(move_centroid_row(:,:,i), move_centroid_col(:,:,i), 1) = 255;
move_image(move_centroid_row(:,:,i), move_centroid_col(:,:,i), 2) = 255;
move_image(move_centroid_row(:,:,i), move_centroid_col(:,:,i), 3) = 255;

move_image(:,:,i) = make_odd_by_odd1(move_image(i));
[move_num_rows(:,:,i), move_num_cols(:,:,i), move_num_layers(:,:,i)] = size(move_image(:,:,i));

move_goal_row(:,:,i) = ((move_num_rows(:,:,i) - 1) / 2) + 1;
move_goal_col(:,:,i) = ((move_num_cols(:,:,i) - 1) / 2) + 1;

move_delta_rows(:,:,i) = move_goal_row(:,:,i) - move_centroid_row(:,:,i);
move_delta_cols(:,:,i) = move_goal_col(:,:,i) - move_centroid_col(:,:,i);

move_image(:,:,i)= circshift(move_image(:,:,i), ([move_delta_rows(:,:,i), move_delta_cols(:,:,i)]));
move_delta_cols(:,:,i)]);

end;

"Doug Hull" <hull@mathworks.SPAMPROOFcom> wrote in message <ieaqq4$sk5$1@fred.mathworks.com>...
> Glad to see this code is still useful.  I agree with the above suggestion.  If you are still having problems, please contact me.
>
> Doug

 0
Reply Anitha 12/18/2010 2:24:07 PM

On 18/12/10 8:24 AM, Anitha wrote:
> I am still not sure how I can change it to a vector and non-sparse. It
> is a 1 by 1 by 25 double array now.

> for i = startFrame:endFrame

> move_bw_plane_of_interest(:,:,i) = im2bw(move_image(:,:,i),
> graythresh(move_image(:,:,i)));

move_image(:,:,i) is going to be the i'th frame of a movie image, right?
So then move_image(:,:,i) would be a 2D array rather than a vector.
im2bw() is going to retain that 2D array shape, so
move_bw_plane_of_interest is going to be a 2D array.

> move_plane_of_interest_segmented(:,:,i) =
> bwmorph(move_bw_plane_of_interest(:,:,i), 'open');

Taking the morphology of a 2D shape returns a 2D shape.

> imfill(move_plane_of_interest_segmented(:,:,i), 'holes');

Filling a 2D shape returns a 2D shape.

> move_properties(:,:,i) = regionprops(real(move_binary_mask(:,:,i)),'all');

Taking the region properties of a 2D array will return a structure array
vector with one element per identified object. As the only values in
your array are 0's and 1's, you will have only one identified object,
and hence the structure array will have one element.

> move_centroid_row(:,:,i) = round(move_properties(:,:,i).Centroid(2));
> move_centroid_col(:,:,i) = round(move_properties(:,:,i).Centroid(1));

Those copy scalars, so move_centroid_row and _col will be 1 by 1 by the
frame number

> move_image(move_centroid_row(:,:,i), move_centroid_col(:,:,i), 1) = 255;
> move_image(move_centroid_row(:,:,i), move_centroid_col(:,:,i), 2) = 255;
> move_image(move_centroid_row(:,:,i), move_centroid_col(:,:,i), 3) = 255;

In the im2bw() call, you retrieved move_image(:,:,i) but here you are
setting move_image(r,c,1:3) which is presumably _intended_ to affect the
R, G, and B channels of something. Instead it is going to affect frames
1 to 3. Unless, that is, move_image is intended to be an RGB color
image, in which case if your start or end frame are more than 3 you
would have bombed out immediately...

> move_image(:,:,i) = make_odd_by_odd1(move_image(i));

Here you extract the element of move_image which happens to have the
same offset as the frame number. Offsets in arrays run down the first
column, then down the second, so until you get to a frame number which
happens to be as large as the image height, you will be retrieving the
left-hand border of the first frame. You make that value odd, and store
it at _all_ locations in the current frame.

Things get weirder after that.

I would suggest that you need to rethink your code. And if you are
storing a single scalar value to create a vector, please do not confuse
the readers by storing it in to a 3D array indexed at (:,:,i) -- just

 0
Reply Walter 12/20/2010 5:48:28 AM

4 Replies
478 Views

Similar Articles

12/6/2013 10:16:51 AM
page loaded in 29325 ms. (0)

Similar Artilces:

Unknown error
I'm suddenly getting this error in my postscript document, much to large to past here, Here is the error: Error: /rangecheck in --%op_show_continue-- I don't have anything in my postscript by the name of op_show_continue, and I don't know what the % is about, I also thought that % signified a comment. Any help on this would be much appreciated. KevinMullin wrote: > I'm suddenly getting this error in my postscript document > > Error: /rangecheck in --%op_show_continue-- > Any help on this would be much appreciated. Open a bug report at http://bugs.ghostscript.com Don't forget to attach a sample file. KevinMullin <kmullin@clearwire.net> wrote: >I'm suddenly getting this error in my postscript document, much to >large to past here, Here is the error: > >Error: /rangecheck in --%op_show_continue-- At a guess, this is happening in a show which needs to execute code. Perhaps a type 3 font, for example, which has done something wrong in its glyph procedure. Operators which need to interrupt their processing and run procedures may well put internal operators you or I never heard of out there to resume execution

Error #2
hi, i've got this error Feb 10 03:10:14 rrhh SRS Proxy[23092]: [ID 711089 daemon.error] unhandled exception: open_store open(/var/SUNWsrspx/SRSQueueStore/ store/.free) error: 13 what can i do? thx, Plactoon On Feb 12, 7:40 pm, "Plactoon" <elsersupr...@hotmail.com> wrote: > hi, i've got this error > > Feb 10 03:10:14 rrhh SRS Proxy[23092]: [ID 711089 daemon.error] > unhandled exception: open_store open(/var/SUNWsrspx/SRSQueueStore/ > store/.free) error: 13 > > what can i do? > > thx, > > Plactoon This error is related to the Net connect, you check the netconnect portal , might be for this server netconnect notable to polling the server status so just restart this srs service it will work.. regards, Nikunj Khakhar.

Bus Error?
Hi, I have following 2 questions: * What is bus error? * How is it different from segmentation fault? Thanks -------------------------------------------------------------- "We approached the case, you remember Watson," said Mr. Homles, "with an absolutely blank mind, which is always an advantage." On Mon, 29 Sep 2003 10:15:56 +0530, "Vijay Kumar R Zanvar" <vijoeyz@hotmail.com> wrote in comp.lang.c: > Hi, > I have following 2 questions: > > * What is bus error? > * How is it different from segmentation fault? >... compiler on your particular operating system. In general, they are both the result of something wrong in your program, an error that produces undefined behavior. When your program generates undefined behavior C no longer specifies what might happen, and things like "bus error" and "segmentation faults" are the results of certain types of undefined behavior on your particular system. To find out for sure you need to ask in a group that supports your particular compiler/OS combination. For several common such combinations, a segmentation fault results when your program

mput error
Hello Friends, I am trying to dump/upload a file to the 'ftp.mathworks.com' sewrver. I have created a 'test.txt' folder in my matlab working directory. This file i want to dump in math works ftp site. The code is as stated - tmw=ftp('ftp.mathworks.com') mput(tmw,'C:\soft\test.txt'); The connection ius done but on running mput i get ??? Error using ==> ftp.mput at 80 Illegal file name "test.txt". Can anyone help me out ? Regards, Vinod. "LFG Tech" wrote in message <jsfhlb$jp9$1@newscl01ah.mathworks.com>... > Hello Friends, > > I am trying to dump/upload a file to the 'ftp.mathworks.com' sewrver. > I have created a 'test.txt' folder in my matlab working directory. > > This file i want to dump in math works ftp site. > The code is as stated - > tmw=ftp('ftp.mathworks.com') > mput(tmw,'C:\soft\test.txt'); > > The connection ius done but on running mput i get > ??? Error using ==> ftp.mput at 80 > Illegal file name "test.txt". > > Can anyone help me out ? > Regards, > Vinod. Could

Mutex error
Anyone else running netbsd-current 1.6W getting mutex errors when trying to run xmms? -- _____________________________ http://mrnobody.freeshell.org|__ mrnobody@nospam.sdf.lonestar.org|_______________________ SDF Public Access UNIX System - http://sdf.lonestar.org| ------------------------------------------------------- Ben Eisenberg wrote: > Anyone else running netbsd-current 1.6W getting mutex errors when trying to run xmms? I compiled xmms just for you ;-) No mutex errors, or any other errors either. Not even when doing a system re-compile while playing an mp3. I've never bee

Error with JDeveloper
Hi, i have a problem. I downloaded the new Jdeveloper 10.3.1. When a try to run a class i always receive the error: "process exited with exit code 128". The compilation is correct. My OS is Win2003 server SP1, but i tried in a pc with the same OS and it works correctly. If i run the class from command line without the -ojvm option it works correctly. Someone has got an idea? <dcollina@gmail.com> wrote in message news:1142415379.644997.17370@u72g2000cwu.googlegroups.com... > Hi, > i have a problem. I downloaded the new Jdeveloper 10.3.1. When a try to > run a class i always receive the error: "process exited with exit code > 128". The compilation is correct. My OS is Win2003 server SP1, but i > tried in a pc with the same OS and it works correctly. > If i run the class from command line without the -ojvm option it works > correctly. > Someone has got an idea? > According to http://msdn.microsoft.com/library/default.asp?url=/library/en-us/debug/base/system_error_codes__0-499_.asp, error 128 is: ERROR_WAIT_NO_CHILDREN - There are no child processes to wait for. I know what a child process is but I'm not sure what

JVA0122 Error
I am getting following java error when running a job . " Java program completed with exti code 1 Function Check. JVA0122 unmonitored by CS_ASSIGN at statement 1000, instruction X'0016'. JVA0122 recieved by CS_ASSIGN at 1000. (C D I R)." Does anyone know what might be causing this error and how to resolve it. Thanks! Suketu Patel wrote: > > I am getting following java error when running a job . > > " Java program completed with exti code 1 > Function Check. JVA0122 unmonitored by CS_ASSIGN at statement 1000, > instruction X'0016'. > JVA0122 recieved by CS_ASSIGN at 1000. (C D I R)." > > Does anyone know what might be causing this error and how to resolve > it. Thanks! Maybe the java program exits someway different from System.exit(0) or it crashes while running. -- Dr.Ugo Gagliardelli,Modena,ItalyCertifiedUindoscrasherA�ejoAlcoolInside Spaccamaroni andate a cagare/Spammers not welcome/Spammers v�o � merda Spamers iros a la mierda/Spamers allez vous faire foutre Spammers loop schijten/Spammers macht Euch vom Acker

ModelSim Error
hi could somebody help me with this error message i get from model sim se? i'm trying to simulate (post place and route) my design and get the following error message: "error code: Failure: (vsim-3807) Types do not match between component and entity for port key_input" My signal key_input is a integer right now (normally it is my own data type but i changed it because i thought perhaps models sim can't handel that). if i change it to std_logic i can simulate. the behavioral simulation works just fine even with my datatype. i checked my design module and the test bench... through all the phases. Regards, J=2EAnil Kumar. u_stadler@yahoo.de wrote: > hi > > could somebody help me with this error message i get from model sim se? > i'm trying to simulate (post place and route) my design and get the > following error message: > "error code: Failure: (vsim-3807) Types do not match between component > and entity for port key_input" > > My signal key_input is a integer right now (normally it is my own data > type but i changed it because i thought perhaps models sim can't handel > that). if i change it to std_logic i

java.lang.OutOfMemory Error
servlet engine set to buffer the output? If so, try overriding that -- in the JSP world it would be with a page directive like the following, not sure what it would be for a servlet: <%@ page buffer="none" %> I am running IBM AIX 4.3. I can't do much on the server as I don't have control over it. I can read Websphere logs though. They just say java.lang.OutOfMemory error. I read a lot on the net, but couldn't find any concrete conclusion as to what might cause the error. Some people are debating that if a loop has String a = "b" + "c"...; rs.previous(); > [snip] > } //end of while loop > If your rs.next() fails, you will still do rs.previous(). You should skip the call to previous also if the next fails, so put it inside that 'if' statement. If you get an OutOfMemory error, the problem is an infinite loop + dynamic allocation ('append' in this case) with a 99% chance IME. --Paul You are right Ben. I commented all the code inside the loop and had just one int variable incrementing to count the rows and the memory consumption still went up from 90MB to 272MB. With all the code it goes

Graphics_Error
error in log.file ------------------------------------------------------------------------ No errors were reported during the execution of . *** Error File is empty! *** WinEdt captured the following console output: This is BibTeX, Version 0.99d (MiKTeX 2.9) The top-level auxiliary file: test.aux I found no \bibdata command---while reading file test.aux I found no \bibstyle command---while reading file test.aux (There were 2 error messages) *** BibTeX produced the following log file "test.blg"... picture up above. > \end{document} > ------------------------------------------------------------------------- > > where the file myimage is in the same directory where tex file is. I > am getting the following error in log.file > > ------------------------------------------------------------------------ > No errors were reported during the execution of . > *** Error File is empty! > > *** WinEdt captured the following console output: > > This is BibTeX, Version 0.99d (MiKTeX 2.9) > The top-level auxiliary file: test.aux > I found