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

Error using "lung" tool #54

Open
Gweiqi opened this issue Jan 12, 2022 · 1 comment
Open

Error using "lung" tool #54

Gweiqi opened this issue Jan 12, 2022 · 1 comment

Comments

@Gweiqi
Copy link

Gweiqi commented Jan 12, 2022

Dear Developers,
When I use the "lung" tool, I encounter the following error,
Error in PTKWatershedFromStartingPoints(PTK1.0.1) : PTKWatershedMeyerFromStartingPoints has not been compiled. You must compile using mex PTKWatershedFromStartingPoints. Alternatively, use the slower Matlab equivalent function mex PTKWatershedFromStartingPointsMatlab().
Stack:PTKWatershedFromStartingPoints(12); SeparateLungs(186); PTKSeparateAndLabelLungs(30); PTKGetLeftAndRightLungs(16); PTKLeftAndRightLungsInitialiser.RunPlugin(55); MimContextHierarchy.GetResultRecursive(192); MimDatasetResults.GetResult(126); MimDatasetCallback.GetResult(87); PTKLeftAndRightLungs.RunPlugin(50); MimContextHierarchy.GetResultRecursive(192); MimDatasetResults.GetResult(126); MimDataset.GetResultWithCacheInfo(148); MimGuiDataset.RunPluginTryCatchBlock(683); MimGuiDataset.RunPlugin(449); MimGuiBase.RunPluginCallback(604); PTKSegmentLungs.RunGuiPlugin(33); MimGuiBase.RunGuiPluginCallback(581); MimGuiPluginWrapper.RunPlugin(21); @(varargin)tool_wrapper.RunPlugin(varargin{:})(255); MimPluginLabelButton.ButtonClickedCallback(48); @(varargin)obj.ButtonClickedCallback(varargin{:})(40); GemButton.ButtonClickedCallback(134); @(varargin)obj.ButtonClickedCallback(varargin{:})(109); \n

I look forward to your help, thank you very much!
Guo Weiqi

@tomdoel
Copy link
Owner

tomdoel commented Jan 17, 2022

Hi,

You need to install a Matlab-compatible C++ compiler.

Some of PTK's functions are written as C++ mex files and they need to be compiled before use. PTK will normally do this automatically, but only if Matlab is able to find a compatible C++ compiler for your system.

This is covered in section 2 of the PTK installation instructions although please note the suggested compiler information was written several years ago so is not up to date. You should follow the recommended compiler installation instructions from Mathworks for your particular version of Matlab.

Mathworks provide a list of supported compilers for current and previous versions of Matab.

Once you have installed a compiler, you can verify that Matlab can find your C++ compiler, by running the following on the Matlab command window:

>> mex -setup

If Matlab can find your C++ compiler, you can instruct PTK to try recompiling the mex files:

>> ptk_main = PTKMain();
>> ptk_main.Recompile();

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