why in hell the uigetdir works so slowly?

  • Follow


I use Matlab R2009a to do some image processing, since there are many images in my folder, I use uigetdir to do batch processing. However, the program worked so slowly that I almost be crazy about that. I think I can not bear the waiting time of more than 10 minutes. 

I just woder why in hell the uigetdir function works so slowly? Is there anyone who suffered the same problem? Can anyone give me a hand?
0
Reply Fu 4/3/2010 3:34:05 AM

For me, the first time it's called, it takes about 3-4 seconds to come
up.  After the first time, it's virtually instantaneous.  I'm not
gloating - I'm just telling you how it works on my computer.

Say, why don't you upgrade to R2010a?  It's the latest release.  Why
not get current, and maybe the problem will go away?
0
Reply ImageAnalyst 4/3/2010 3:46:32 AM


Thanks for your reply, it is my first question here in Math Works community, and English is not my native language, excuse me for some poor expressing.

Your program need your 3 to 4 seconds, but mine need more than ten minutes. I wonder if there is any problem in my matlab software, so I uninstall my software, expecting the programm works efficiently. Unfortunately, it failed.

You suggest to use 2010a, I think it is a good idea. At the same time, I think it should be the last choice.
0
Reply Fu 4/3/2010 4:01:18 AM

I'm curious as to why using the latest greatest version is your last
choice.  For me upgrading was quick and painless.  I guess if you are
unwilling to upgrade your MATLAB, then you're probably unwilling to
upgrade your Java (which would have been my next suggestion) or
anything else.
0
Reply ImageAnalyst 4/3/2010 4:10:34 AM

I don't know why it should quite take that long, but as a workaround have you tried to call UIGETDIR up one level?  If there are just tons of files in the current directory, this might slow things down.  I am not sure though.

For example,

C = pwd
D = strfind(C,'\');
D = uigetdir(C(1:(D(end)-1)))
0
Reply Matt 4/3/2010 4:25:06 AM

Thanks for your reply.

The moment I got the Matlab2010  releasing news, I come to see "what's new" of Matlab, and I found almost nothing  related to my project. So I stand still. 

I will upgrade my Matlab right away,  thanks for your suggestion. If there is till problem of uigetdir or not, I will turn to this topic again, for help or for thanks.
0
Reply Fu 4/3/2010 4:29:04 AM

"Matt Fig" <spamanon@yahoo.com> wrote in message <hp6fv2$sel$1@fred.mathworks.com>...
> I don't know why it should quite take that long, but as a workaround have you tried to call UIGETDIR up one level?  If there are just tons of files in the current directory, this might slow things down.  I am not sure though.
> 
> For example,
> 
> C = pwd
> D = strfind(C,'\');
> D = uigetdir(C(1:(D(end)-1)))

I tried this way,  changed my codes, but it still refuse to work efficiently. In my codes, I intend to access the directory of 'F:\final images', in which there are lots of images, and I used the way you provided, but nothing better. 

By the way, when I use uigetdir, sometimes it works efficiently to access a folder contains nothing, sometimes not. I also have to wait for several minutes at least.
0
Reply Fu 4/3/2010 4:48:03 AM

ImageAnalyst <imageanalyst@mailinator.com> wrote in message <5288469b-73a4-46ad-8d47-d5b7d880022d@q16g2000yqq.googlegroups.com>...
> For me, the first time it's called, it takes about 3-4 seconds to come
> up.  After the first time, it's virtually instantaneous.  I'm not
> gloating - I'm just telling you how it works on my computer.

I think it is helpful to know, in function uigetdir what is matlab doing?
0
Reply Fu 4/3/2010 4:51:04 AM

"Fu jizi" <shuchong1987@163.com> wrote in message <hp6g6g$21o$1@fred.mathworks.com>...
> Thanks for your reply.
> 
> The moment I got the Matlab2010  releasing news, I come to see "what's new" of Matlab, and I found almost nothing  related to my project. So I stand still. 
> 
> I will upgrade my Matlab right away,  thanks for your suggestion. If there is till problem of uigetdir or not, I will turn to this topic again, for help or for thanks.

There are other reasons for the upgrade, since 2009 had
a bug or two in it that has been repaired.

But surely a directory with a gazillion images in it may
be difficult to deal with, and it is probably an issue with
an interaction between your OS/network/Java/MATLAB.
You may find that it helps to break things up more, or
get more memory.

John
0
Reply John 4/3/2010 8:27:05 AM

ImageAnalyst <imageanalyst@mailinator.com> wrote in message <df8ee4b0-c4e9-4f03-a658-33da3451b7ed@w17g2000yqj.googlegroups.com>...
> I'm curious as to why using the latest greatest version is your last
> choice.  For me upgrading was quick and painless.  I guess if you are
> unwilling to upgrade your MATLAB, then you're probably unwilling to
> upgrade your Java (which would have been my next suggestion) or
> anything else.

I reinstalled Matlab, use 2010 rather than 2009. The result is not bad, it works efficiently, and it cost less than 10 seconds to choose a directory, at least up to now.

I hope it will keep good, don't make me that crazy again. If there is something wrong in the future, I will come back to report my problem.

Thank you very much, and the same to John D'Errico. Thanks for your kindness. 
0
Reply Fu 4/3/2010 11:06:05 AM

"Fu jizi" <shuchong1987@163.com> wrote in message 
news:hp6cvd$jca$1@fred.mathworks.com...
>I use Matlab R2009a to do some image processing, since there are many 
>images in my folder, I use uigetdir to do batch processing. However, the 
>program worked so slowly that I almost be crazy about that. I think I can 
>not bear the waiting time of more than 10 minutes.
> I just woder why in hell the uigetdir function works so slowly? Is there 
> anyone who suffered the same problem? Can anyone give me a hand?

UIGETDIR shouldn't take _that_ long to run, unless you're calling it inside 
a loop or you're starting in or navigating to a directory that has a large 
number of subdirectories.  Care to show the group how you're calling 
UIGETDIR?

-- 
Steve Lord
slord@mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ 


0
Reply Steven 4/5/2010 3:58:39 AM

Dear Fu jizi!

> I use Matlab R2009a to do some image processing, since there are many images in my folder, I use uigetdir to do batch processing. However, the program worked so slowly that I almost be crazy about that. I think I can not bear the waiting time of more than 10 minutes. 

I cannot imagine that this is a problem of UIGETDIR. How long takes a simple DIR command in the same folder? Perhaps it is a problem of the network connection to a remote drive?
Even 10 seconds is much more than I'd expect. On my 1.5GHz Pentium-M WinXP 32, UIGETDIR takes about one second for Matlab 6.5, 2008b, 2009a --- when accessing a folder on a local hard drive.

Good luck, Jan
0
Reply Jan 4/5/2010 9:37:04 PM

> UIGETDIR shouldn't take _that_ long to run, unless you're calling it inside 
> a loop or you're starting in or navigating to a directory that has a large 
> number of subdirectories.  Care to show the group how you're calling 
> UIGETDIR?
> 
***************************
Dear steven,

Of  course I care nothing to show the way I use UIGETDIR,  and I will be apprieciate that you help me to find the critical point. The situation is that I want to navigate to a 'F:\filetobeprocessed\', which has 3559 files, each with size 1.2M or more. Too much files and too big file? But my computer is new. Pentium(R) Dual-core CPU E5200 @2.5GHZ. memory: 3.25G.

I wanted to use uigetdir to get the file directory 'fileDir', then cd(fileDir) to use my algorithm to do some procession. Problem is that it works so slowly to navigate.

Some times I could not wait that long time, so I use Ctrl+C to terminated. I tried again, it still let me wait, wait, and wait. At this time, even I chose directory without any suvfolder or file would be difficult.

Thank your for considering my problem, it is very kind of you.
0
Reply Fu 4/6/2010 2:18:06 AM

Dear Jan Simon,

You questioned me how long does it take to run DIR in the same folder, and I did a simple test just now, it toke only 0.0158 seconds. (I used TIC TOC to get the time elapsed). I am not using matlab in network, for I just process some files in my own computer.

You mean maybe it is not UIGETDIR that caused the problem?

wait for your reply. Thank you very much, Jan. Best wishes.
0
Reply Fu 4/6/2010 2:28:04 AM

Dear Fu!

> You questioned me how long does it take to run DIR in the same folder, and I did a simple test just now, it toke only 0.0158 seconds. (I used TIC TOC to get the time elapsed). I am not using matlab in network, for I just process some files in my own computer.
> 
> You mean maybe it is not UIGETDIR that caused the problem?

UIGETDIR does not have to perform any complex work, so I assume, there is another problem. Perhaps Java runs out of memory?!
What happens for repeated calling of UIGETDIR in the same folder?
Does UIPUTFILE need remarkable time also?

Jan
0
Reply Jan 4/6/2010 11:59:04 AM

Hi Jan, 

I am so happy that you answer me again. I tested the UIPUTFILE in my computer; it worked quickly. I run it, chose the very folder, wrote a filename, and then got the time elapsed. Totally it was less than 10 seconds.

You mentioned Java. Sorry to tell you that I know little about that, and there is no hint showing me java is out of memory. 

I didn't repeat calling UIGETDIR. I only call it once to get the directory, after that there is none of its business.

Something more, I use UIGETFILE in the very folder, it worked efficiently.

Thanks for your help. Best Wishes to you, Jan.
0
Reply Fu 4/7/2010 2:54:05 AM

I want to reinstall my java, but i do not know how to do that, can anybody help me?
0
Reply Fu 4/12/2010 8:57:03 AM

16 Replies
533 Views

(page loaded in 0.131 seconds)

Similiar Articles:


















7/24/2012 3:31:41 AM


Reply: