Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What is the best way to install ImageM? #3

Open
ctrueden opened this issue Sep 9, 2021 · 3 comments
Open

What is the best way to install ImageM? #3

ctrueden opened this issue Sep 9, 2021 · 3 comments
Assignees

Comments

@ctrueden
Copy link

ctrueden commented Sep 9, 2021

I tried several ways of installing ImageM, running into many problems before finding a solution that worked:

  • Installed MATLAB R2021a with Image Processing and Statistics and Machine Learning toolboxes.

  • Installed ImageM via the Add-On Manager. Then:

    >> ImageM
    Starting the ImageM application...
    Unable to resolve the name uix.VBox.
    
    Error in imagem.gui.PlanarImageViewer/PlanarImageViewer/setupLayout (line 91)
        mainPanel = uix.VBox('Parent', hf, ...
    
    Error in imagem.gui.PlanarImageViewer (line 59)
        setupLayout(fig);
    
    Error in imagem.gui.ImagemGUI/createImageFrame (line 97)
        frame = imagem.gui.PlanarImageViewer(obj, doc);
    
    Error in ImageM (line 64)
        viewer = createImageFrame(gui, img);
    
    >> 
    
  • Installed ImageM and GUI Layout Toolbox via the Add-On Manager. Then:

    >> ImageM
    Starting the ImageM application...
    create a new image
    Unable to resolve the name Image.create.
    
    Error in imagem.actions.file.CreateImage/run (line 70)
        img = Image.create([dimX dimY], dataType);
    
    Error in imagem.gui.FrameMenuBuilder>@(src,evt)action.run(obj.Frame) (line 475)
        'Callback', @(src, evt) action.run(obj.Frame));
    
    Error while evaluating Menu Callback.
    
  • Searched Add-On Explorer for "mattools". Installed geom2D and geom3D and MatStats and MatImage. Then:

    >> ImageM
    Starting the ImageM application...
    create a new image
    (same error as before)
    
  • Tried running installMatImage.m:

    >> installMatImage
    Installing MatImage Library
    Adding module: util                Warning: Name is nonexistent or not a directory: /home/curtis/MATLAB Add-Ons/Toolboxes/MatImage/matImage/util 
    > In path (line 109)
    In addpath (line 86)
    In installMatImage (line 44) 
     (done)
    Adding module: imFilters            (done)
    Adding module: imMeasures           (done)
    Adding module: imMinkowski          (done)
    Adding module: imGeodesics          (done)
    Adding module: imGranulometry       (done)
    Adding module: imShapes             (done)
    Adding module: imStacks             (done)
    
    >> ImageM
    create a new image
    (same error as before)
    
  • Downloaded ImageM-1.3.2.1-full.mlappinstall and opened it in MATLAB. This added ImageM as an app.

  • From APPS tab, clicked ImageM toolbar button to launch.

    Received errors:
    
    Warning: Name is nonexistent or not a directory: /home/curtis/MATLAB Add-Ons/libs\matGeom\geom2d 
    > In path (line 109)
    In addpath (line 86)
    In ImageM (line 36)
    In ImageMApp/startApp (line 86)
    In ImageMApp (line 48)
    In appinstall.internal.runapp>execute (line 116)
    In appinstall.internal.runapp>runapp13a (line 95)
    In appinstall.internal.runapp>preamble18b (line 60)
    In appinstall.internal.runapp (line 13)
    In matlab.apputil.run (line 45) 
    Warning: Name is nonexistent or not a directory: /home/curtis/MATLAB Add-Ons/libs\matGeom\polygons2d 
    > In path (line 109)
    In addpath (line 86)
    In ImageM (line 37)
    In ImageMApp/startApp (line 86)
    In ImageMApp (line 48)
    In appinstall.internal.runapp>execute (line 116)
    In appinstall.internal.runapp>runapp13a (line 95)
    In appinstall.internal.runapp>preamble18b (line 60)
    In appinstall.internal.runapp (line 13)
    In matlab.apputil.run (line 45) 
    Warning: Name is nonexistent or not a directory: /home/curtis/MATLAB Add-Ons/libs\matGeom\geom3d 
    > In path (line 109)
    In addpath (line 86)
    In ImageM (line 38)
    In ImageMApp/startApp (line 86)
    In ImageMApp (line 48)
    In appinstall.internal.runapp>execute (line 116)
    In appinstall.internal.runapp>runapp13a (line 95)
    In appinstall.internal.runapp>preamble18b (line 60)
    In appinstall.internal.runapp (line 13)
    In matlab.apputil.run (line 45) 
    Warning: Name is nonexistent or not a directory: /home/curtis/MATLAB Add-Ons/libs\matGeom\meshes3d 
    > In path (line 109)
    In addpath (line 86)
    In ImageM (line 39)
    In ImageMApp/startApp (line 86)
    In ImageMApp (line 48)
    In appinstall.internal.runapp>execute (line 116)
    In appinstall.internal.runapp>runapp13a (line 95)
    In appinstall.internal.runapp>preamble18b (line 60)
    In appinstall.internal.runapp (line 13)
    In matlab.apputil.run (line 45) 
    Warning: Name is nonexistent or not a directory: /home/curtis/MATLAB Add-Ons/libs\matGeom\utils 
    > In path (line 109)
    In addpath (line 86)
    In ImageM (line 40)
    In ImageMApp/startApp (line 86)
    In ImageMApp (line 48)
    In appinstall.internal.runapp>execute (line 116)
    In appinstall.internal.runapp>runapp13a (line 95)
    In appinstall.internal.runapp>preamble18b (line 60)
    In appinstall.internal.runapp (line 13)
    In matlab.apputil.run (line 45) 
    Warning: Name is nonexistent or not a directory: /home/curtis/MATLAB Add-Ons/libs\matStats 
    > In path (line 109)
    In addpath (line 86)
    In ImageM (line 43)
    In ImageMApp/startApp (line 86)
    In ImageMApp (line 48)
    In appinstall.internal.runapp>execute (line 116)
    In appinstall.internal.runapp>runapp13a (line 95)
    In appinstall.internal.runapp>preamble18b (line 60)
    In appinstall.internal.runapp (line 13)
    In matlab.apputil.run (line 45) 
    Warning: Name is nonexistent or not a directory: /home/curtis/MATLAB Add-Ons/libs\imageClass 
    > In path (line 109)
    In addpath (line 86)
    In ImageM (line 46)
    In ImageMApp/startApp (line 86)
    In ImageMApp (line 48)
    In appinstall.internal.runapp>execute (line 116)
    In appinstall.internal.runapp>runapp13a (line 95)
    In appinstall.internal.runapp>preamble18b (line 60)
    In appinstall.internal.runapp (line 13)
    In matlab.apputil.run (line 45) 
    create a new image
    Open new Image 
    >>
    
  • Edited MATLAB Add-Ons/Apps/ImageM/D__/dlegland/dev/matlab/image/ImageM/package/full/ImageM/ImageM.m to fix the slashes.

  • Launched ImageM app again. Same error.

  • Restarted MATLAB. Launched ImageM app again. Same error.

  • But, despite these errors, the application seems to function.

It would be great to have better documentation in the README about how to install ImageM properly. Thanks!

@dlegland
Copy link
Member

dlegland commented Sep 9, 2021

Hi Curtis,

thank you for your investigations, your detailed report, and sorry for the difficulties you encountered...

The managment of dependencies with Matlab is complicated, and the ImageM application has many. I think the one you missed was "mattools/matlab-image-class" (the package containing the "Image" class, and the "Image.create" static factory). This package has the "matgeom" and the "matStats" as dependencies, but as you already installed them, this should be ok.

I was trying to package whole the dependencies into a single mlapp file, but obviously this was not successful. I will check this, and provide a new version.

Anyway, I agree I need to seriously update the user manual to make the app easier to install.

But, despite these errors, the application seems to function.

Thanks for staying positive despite the huge list of problems...

Best,
David

@dlegland dlegland self-assigned this Sep 9, 2021
@ctrueden
Copy link
Author

ctrueden commented Sep 10, 2021

@dlegland Thanks for the quick reply!

I was trying to package whole the dependencies into a single mlapp file, but obviously this was not successful.

The ImageM-1.3.2.1-full.mlappinstall bundle does work for me, for what it's worth. Thanks for that. The issue here is only about trying to run ImageM without importing the whole thing as an app.

I think the one you missed was "mattools/matlab-image-class" (the package containing the "Image" class, and the "Image.create" static factory).

Huh, I had assumed that the Add-on called "MatImage" was covering that, but yeah, I see that Image.m isn't in there:

$ find . -name '*Image.m'
./Toolboxes/MatImage/matImage/installMatImage.m
./Toolboxes/MatImage/matImage/imFilters/convexImage.m
./Toolboxes/MatImage/matImage/imFilters/imConvexImage.m
./Toolboxes/MatImage/matImage/imFilters/createImage.m
./Toolboxes/MatImage/matImage/imMeasures/isColorImage.m
./Toolboxes/MatImage/matImage/imMeasures/is3DImage.m
./Collections/ImageM/ImageM/+imagem/+actions/+table/FoldTableToImage.m
./Collections/ImageM/ImageM/+imagem/+actions/+file/OpenImage.m
./Collections/ImageM/ImageM/+imagem/+actions/+file/OpenDemoImage.m
./Collections/ImageM/ImageM/+imagem/+actions/+file/CreateImage.m
./Collections/ImageM/ImageM/+imagem/+actions/+file/SaveImage.m
./Collections/ImageM/ImageM/+imagem/+actions/+image/FlipImage.m
./Collections/ImageM/ImageM/+imagem/+actions/+image/DuplicateImage.m
./Collections/ImageM/ImageM/+imagem/+actions/+image/InvertImage.m
./Collections/ImageM/ImageM/+imagem/+actions/+image/ReshapeImage.m
./Collections/ImageM/ImageM/+imagem/+actions/+image/RenameImage.m
./Collections/ImageM/ImageM/+imagem/+actions/+image/UnfoldVectorImage.m
./Collections/ImageM/ImageM/+imagem/+actions/+image/ConvertImage3DToVectorImage.m

So is there an add-on available from the Add-on Manager containing the mattools/matlab-image-class code?

One thing you could do that might be cool would be to check proactively for certain classes early in ImageM's startup, and if one is not found, print a friendlier error message stating which dependency is missing from the environment.

@dlegland
Copy link
Member

dlegland commented Sep 13, 2021

Hi,

Huh, I had assumed that the Add-on called "MatImage" was covering that, but yeah, I see that Image.m isn't in there

I fear that the two packages "MatImage" (a function-based library for image processing) and "matlab-image-class" (a class-based image library) can induce some confusion. The result of codebase with rather long history... I will try to improve the docs for both packages. Both have their utility, and can be used together.

So is there an add-on available from the Add-on Manager containing the mattools/matlab-image-class code?

Well, in theory yes... There is a page on the FileExchange. But I agree it is not straightforad to know it should be installled, and the manual should be improved to provide a more easy-to-install package.

check proactively for certain classes early in ImageM's startup

Yes! very good idea, I'll implement it for next release, I hope soon.

Thanks a lot for the suggestions, this will improve the next version.

Best,
David

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants