-
Notifications
You must be signed in to change notification settings - Fork 17
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
run simpleMontage.py get error ITK ERROR: Object factory failed to instantiate class itk::RealToHalfHermitianForwardFFTImageFilter on windows 10 #214
Comments
@tbirdso Could this be related to FFT refactoring? |
@dzenanz Sounds possible. I will work to reproduce on my end. |
Hi @zhusihan-python , I am having difficulty in reproducing the error that you describe. The
A couple of questions to help us investigate:
I have identified a small error later in |
@tbirdso hi sir i build itk by myself, and i set ITK_BUILD_DEFAULT_MODULES ON, you can see that on the itk configure picture i upload i can't reproduce the error use the ITKMontage Python release from PyPI, i try to reinstall itk itk-montage from pypi, then tried the MNML_5_500x_101 files, it get another error like this:
itk.TileMergeImageFilter is not wrapped for input type one of my environment is windows 10, python 3.10.10, i remove itk i build and reinstall itk itk-montage from pypi, SimpleMontage.py is the same as in this repo
|
Hi @zhusihan-python , thank you for the detailed description. The Windows error you described in |
thank you for the help, it works perfect on windows now in montage 0.7.3 the rgb image support should be like this |
Great, glad to hear it. I'll leave this issue open for now in case someone has bandwidth to investigate the C++ object factory instantiation failure. It sounds like using the Python distribution is a sufficient workaround for now. |
I'm posting here for posterity's sake. There were not a lot hits with the exact issue. There was also a forum post on the official ITK forum, but I've decided to post here to make it easier to reference across the github ecosystem. I had the exact same issue using RTK with this:
and I also found that the python code did work, though migrating to python was not a viable option for us. I tracked down the issue to our conan build of ITK. Once I got that, I found that we were never registering the factories. I suspected issues with the static variables and this discussion confirmed my suspicions InsightSoftwareConsortium/ITK#2864 and explains why it works in python but not in our C++ code. Finally, the fix, there are 2 possible fixes:
# assuming that you are not using conan.
include("${PACKAGE_DIR}/lib/cmake/ITK-5.3/ITKConfig.cmake")
include("${PACKAGE_DIR}/lib/cmake/ITK-5.3/UseITK.cmake") where
/*=========================================================================
*
* Copyright NumFOCUS
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0.txt
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*=========================================================================*/
#ifndef itkFFTImageFilterInitFactoryRegisterManager_h
#define itkFFTImageFilterInitFactoryRegisterManager_h
namespace itk {
//
// The following code is intended to be expanded at the end of the
// itk<config>FFTImageFilter.h files
//
void VnlFFTImageFilterInitFactoryRegister__Private();
class FFTImageFilterInitFactoryRegisterManager
{
public:
explicit FFTImageFilterInitFactoryRegisterManager(void (* const list[])(void))
{
for(;*list != nullptr; ++list)
{
(*list)();
}
}
};
//
// The code below registers available FFT helpers using static initialization in
// application translation units. Note that this code will be expanded in the
// ITK-based applications and not in ITK itself.
//
void (* const FFTImageFilterInitFactoryRegisterList[])(void) = {
VnlFFTImageFilterInitFactoryRegister__Private,
nullptr};
const FFTImageFilterInitFactoryRegisterManager FFTImageFilterInitFactoryRegisterManagerInstance(FFTImageFilterInitFactoryRegisterList);
}
#endif |
hi, i build the lastest verion itk 5.3.0 and itk montage 0.8.1 on windows 10 python 3.10.10
run examples/simpleMontage.py get error like below
itk cmake configure
itk montage configure
expectation: itk 5.3.0 and itk montage 0.8.1 run simpleMontage successfully, get a stitched image
The text was updated successfully, but these errors were encountered: