Matlab Compiler and imshow fail on execution
7 views (last 30 days)
Show older comments
We have produced several matlab application for research purpose and I'm looking into compiling them for easier deployment. I've read the documentation and aware that not all parts of matlab can be compiled.
Here is a simple example that compiles but fails on execution:
function [ ] = TestImshow( )
% create image (a white square on a black background)
I = zeros(400, 400, 'uint8');
I(100:300, 100:300) = intmax('uint8');
% show image
imshow(I);
end
Error: Undefined function 'imshow' for input arguments of type 'uint8'.
Version info
MATLAB Version: 8.3.0.532 (R2014a)
MATLAB License Number:
Operating System: Microsoft Windows 7 Enterprise Version 6.1 (Build 7601: Service Pack 1)
Java Version: Java 1.7.0_11-b21 with Oracle Corporation Java HotSpot(TM) Client VM mixed mode
---------------------------------------------------------------------------------------------
MATLAB Version 8.3 (R2014a)
Curve Fitting Toolbox Version 3.4.1 (R2014a)
Database Toolbox Version 5.1 (R2014a)
Image Processing Toolbox Version 9.0 (R2014a)
MATLAB Builder NE Version 4.2.1 (R2014a)
MATLAB Compiler Version 5.1 (R2014a)
Parallel Computing Toolbox Version 6.4 (R2014a)
Signal Processing Toolbox Version 6.21 (R2014a)
Statistics Toolbox Version 9.0 (R2014a)
The imshow function is not explicit listed as a function that cannot be compiled, and if so the mccExcludedFiles.log should list this function during compilation and it doesn't.
Several other users have posted about this problem, also with official answers by Mathworks on how to include the function missing - see this post.
Adding the extra parameter "-a imshow" to mcc or using the function pragma does not solve the problem
function [ ] = TestImshow( )
%# function imshow
...
I also encounter the same issue for dicomwrite, and I think something is fundamentally wrong with my setup or how it is supposed to be used. I've tried on different computers and matlab versions without any luck!
Here is another example with dicomwrite
function [ ] = TestDicom( )
%#function dicomwrite
% create image (a white square on a black background)
I = zeros(400, 400, 'uint16');
I(100:300, 100:300) = intmax('uint16');
% create minimum dicom header with default values
H = struct('PixelSpacing', [1 1], ...
'ImagePositionPatient', [0 0 0], ...
'ImageOrientationPatient', [1 0 0 0 1 0], ...
'ImageType', 'ORIGINAL\\PRIMARY', ...
'RescaleIntercept', -1024, ...
'RescaleSlope', 1);
dicomwrite(I, 'test.dcm', 'ObjectType', 'CT Image Storage', 'CreateMode', 'Create');
end
Error: Undefined function 'dicomwrite' for input arguments of type 'uint16'.
Have any of you succeeded to compile and execute one of these simple examples, and can you (or Mathworks) provide a guidance or solution to this issue with missing functions?
0 Comments
Answers (0)
See Also
Categories
Find more on Troubleshooting in MATLAB Compiler SDK in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!