Code covered by the BSD License  

Highlights from
MorphTool

5.0

5.0 | 5 ratings Rate this file 70 Downloads (last 30 days) File Size: 30.74 KB File ID: #23697
image thumbnail

MorphTool

by Brett Shoelson

 

14 Apr 2009 (Updated 26 Sep 2011)

An interactive environment for morphologically operating on images.

Editor's Notes:

This file was selected as MATLAB Central Pick of the Week

| Watch this File

File Information
Description

MORPHTOOL is an interactive GUI, with which you can try different morphological operations and structuring elements on your image.

This GUI supports most morphological operations, including those (like BWHITMISS) that can take multiple STRELS. All STRELS, including arbitrary ones, are now supported. You can easily see the effects of changing the size or shape of your STREL, or of trying different morphological operations. You can also "activate" the modified image to string operations.

This has been in the works since mid 2007, but has been tested through R2011a.

CAVEAT: I'm still tweaking some aspects of this GUI, and know about a few issues and holes in functionality that I haven't had time to address yet. Nonetheless, I use it frequently, and everyone I've ever shown it to has asked me for it. Comments/suggestions/collaborations welcome.

Required Products Image Processing Toolbox
MATLAB release MATLAB 7.8 (R2009a)
Other requirements NOTE: I use tildes to ignore unneeded arguments; if you use a pre-R2009b version of MATLAB, you will need to replace those tildes with a variable name ('junk').
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (24)
27 May 2009 ababacar kane

important pour mon projet

18 Sep 2009 Diego Orlando  
10 Apr 2010 Samiov

it looks great...but how make it works??? the .fig file isn't in the zipfile!! or I just must be inspired from the .m file???

11 Apr 2010 Brett Shoelson

Sami,
Thanks for the rating. I programmed the GUI manually, without the use of GUIDE. You don't need a .fig file to run it. Just issue the command 'morphtool' (or 'morphtool(myimage)') to run it.
Cheers,
Brett

26 Apr 2010 Nayanjyoti

Simply mind-blowing. Would like to see it include more functionality.

26 Apr 2010 Nayanjyoti

In line 11
"imgName = 'Cameraman.tif';" needs to be replaced with
"imgName = 'cameraman.tif';"

27 Apr 2010 Brett Shoelson

@Nayanjyoti: Thanks for the feedback; I plan to continue ot expand MORPHTOOL. Actually, though (on a PC at least), imread is insensitive to the case of an input image name. So both "imread('Cameralman.tif')" and "imread('cameraman.tif')" work. (IMREAD calls FOPEN under the hood.) Do you see different behavior?

30 Apr 2010 Nayanjyoti

Hi Brett, I tried using a maci64 and glnxa64 and my experience was that when you do
>> I = imread('Cameraman.tif');

you get the following error
??? Error using ==> imread at 372
File "Cameraman.tif" does not exist.

whereas,
>> I = imread('cameraman.tif');
works fine.

10 May 2010 Brett Shoelson

@Nayanjyoti: You are correct: the file is 'cameraman.tif'; my code should reflect that. My windows machine has case-insensitive filename matching, which allowed me to be sloppy. Your Unix environment (correct?) is not. I'll modify the file.

18 Jan 2011 W

Great!Thanks!

19 Aug 2011 Bojan

I'm having a problem running this as it requires StrelTool. Is StrelTool available on file exchange or part of another toolbox?

19 Aug 2011 Jonas

Same error here as Bojan - StrelTool seems to be missing from the package, which makes the potentially awesome submission unusable.

19 Aug 2011 Brett Shoelson

Give me a few minutes, Bojan and Jonas. I accidentally omitted that file when I updated. Working on it.

19 Aug 2011 Brett Shoelson

Bojan, Jonas: Should be good to go now...please re-try! Thanks for the heads up.

01 Sep 2011 YAZ

hi, i have this message :
"??? Error: File: MorphTool.m Line: 185 Column: 3
Expression or statement is incorrect--possibly unbalanced (, {, or [."

06 Sep 2011 Brett Shoelson

@YAZ
Is it possible that you accidentally backspaced and deleted something? I don't see any indication of an unbalanced parenthesis in that file. Would you re-download and verify the error, and let me know if you still see it, please?
Thanks,
Brett

21 Sep 2011 Kelly

I have the same error as YAZ
??? Error: File: MorphTool.m Line: 185 Column: 3
Expression or statement is incorrect--possibly unbalanced (, {, or [.

I did not backspace or delete anything and tried re-downloading it with the same error.

23 Sep 2011 Brett Shoelson

@Kelly and YAZ (and others):

Thanks to you both. I just figured out that you are using a version of MATLAB that predates R2009b. (Correct?) I use tildes to ignore unwanted arguments; that capability was introduced in '9b.) TO FIX THIS: Either upgrade to a newer MATLAB ;), or replace the tildes in my code with some word like "junk." That should do it!

23 Sep 2011 Kelly

Thanks Brett you are right I am using 2009a and the 'junk' insert fixed that error... however now I am getting a different error.

??? Undefined function or method 'tabPanel' for input arguments of type 'cell'.

Error in ==> MorphTool at 177
[mainTabHandle,tabCardHandles,tabHandles] = ...

27 Sep 2011 Brett Shoelson

Please try again; I believe that the current version includes all the files you need to run this. (Please let me know if there are any additional issues with MorphTool...).
Thanks, Bret

25 Oct 2011 recep

I use 2009a but I give problem like it:
??? Undefined function or method 'tabPanel' for input arguments of
type 'cell'.

Error in ==> MorphTool at 177
[mainTabHandle,tabCardHandles,tabHandles] = ...

25 Oct 2011 Brett Shoelson

@recep and Kelly: Would you please verify that you have the latest version, and that it came with the TabPanel function? If not, please grab the new version. If so, it would help if you could tell me reproduction steps that trigger the problem.
Thanks, Brett

25 Oct 2011 Brett Shoelson

recep, Kelly, et al: I see what's happening now. I provided auxiliary files in a folder, assuming that they would be put on your MATLAB path. You can either add those folders manually to the path, or drag the files out of the folders, or issue this (or equivalent) command:

addpath(genpath(fileparts(which('MorphTool.m'))))

Let me know if that addresses the issue, please.

28 Oct 2011 recep

thanks alot it's work

Please login to add a comment or rating.
Updates
05 Sep 2009

9/5/2009 Re-zipped with missing functions StrelTool and expandAxes.

09 Sep 2009

09/09/2009 Provides missing functions/subfunctions.

19 Aug 2011

Fixed stability/responsiveness issue. Also adds support for a number of different morphological operations.

19 Aug 2011

Updating screenshot.

19 Aug 2011

Including omitted StrelTool file.

22 Aug 2011

Changed the description only.

26 Sep 2011

Includes a missing subfunction.

Tag Activity for this File
Tag Applied By Date/Time
image processing Brett Shoelson 14 Apr 2009 11:41:15
gui Brett Shoelson 14 Apr 2009 11:41:15
morphology Brett Shoelson 14 Apr 2009 11:41:15
dilation Brett Shoelson 14 Apr 2009 11:41:15
erosion Brett Shoelson 14 Apr 2009 11:41:15
image filtering Brett Shoelson 14 Apr 2009 11:41:15
strel Brett Shoelson 14 Apr 2009 11:41:15
structuring elements Brett Shoelson 14 Apr 2009 11:41:15
morphology Brian Wandell 17 May 2009 23:39:10
dilation xwendell xiao 03 Sep 2009 18:55:49
morphology xwendell xiao 07 Sep 2009 13:55:41
morphology sisi 06 Jun 2010 20:41:55
hit and miss Morten 14 Jun 2010 17:04:37

Contact us at files@mathworks.com