[Insight-developers] openjpg include dir not exported
Luis Ibanez
luis.ibanez at kitware.com
Sat Aug 28 13:11:51 EDT 2010
Hi Gaetan,
The patch is now available in Gerrit as well
http://review.source.kitware.com/#change,26
Instructions on how to sign up for Gerrit are
available here:
http://www.itk.org/Wiki/ITK/Gerrit
Luis
-----------------------------------------------------------
On Sat, Aug 28, 2010 at 12:56 PM, Luis Ibanez <luis.ibanez at kitware.com>wrote:
>
> Hi Gaetan,
>
>
> Please find attached the patch that uses PIMPL in
> itkJPEG2000ImageIO in order to hide the implementation
> details of openjpeg from ITK developers.
>
>
> You can apply this patch by following the instructions in
>
> http://www.itk.org/Wiki/Git/Publish#Patches
>
>
> Essentially:
>
> 1) Download the patch file
>
> 2) Create a branch in your ITK git repository
>
> git checkout -b openjpegpimpl origin/master
>
>
> 3) Apply the patch as a local commit
>
> git am --whitespace=fix 0001-Used-PIMPL-to-hide-openjpeg-from-ITK-developers.patch
>
>
> 4) Review the changes
>
> git log -p origin/master..
>
>
> 5) Build ITK + WrapITK and verify if this patch
> actually helps solving the problem or not.
>
>
>
> BTW: With this patch, it shouldn't be necessary
> to modify the itkIncludeDirectories.cmake file.
> ITK developers won't have to know that openjpeg
> is used internally.
>
>
> Please let me know how it goes.
>
>
> Thanks
>
>
> Luis
>
>
> -------------------------------------------------------------------------
>
> On Sat, Aug 28, 2010 at 12:17 PM, Luis Ibanez <luis.ibanez at kitware.com>wrote:
>
>> BTW,
>>
>> We probably could use PIMPL in the itkJPEG2000ImageIO
>> class, so that the headers and data structures of openjpeg
>> are not exposed to ITK developers...
>>
>> I'll give it a try...
>>
>>
>> Luis
>>
>>
>> --------------------------------------------------------------------------
>>
>> On Sat, Aug 28, 2010 at 12:15 PM, Luis Ibanez <luis.ibanez at kitware.com>wrote:
>>
>>>
>>> Hi Gaetan,
>>>
>>>
>>> Thanks for the clarification.
>>>
>>>
>>> Can you please try this patch:
>>>
>>> diff --git a/itkIncludeDirectories.cmake b/itkIncludeDirectories.cmake
>>> index 36b2ab5..38584fb 100644
>>> --- a/itkIncludeDirectories.cmake
>>> +++ b/itkIncludeDirectories.cmake
>>> @@ -37,6 +37,7 @@ SET(ITK_INCLUDE_DIRS_BUILD_TREE
>>> ${ITK_INCLUDE_DIRS_BUILD_TREE}
>>> ${ITK_SOURCE_DIR}/Utilities/nifti/niftilib
>>> ${ITK_SOURCE_DIR}/Utilities/nifti/znzlib
>>> ${ITK_SOURCE_DIR}/Utilities/itkExtHdrs
>>> + ${ITK_SOURCE_DIR}/Utilities/openjpeg
>>> ${ITK_BINARY_DIR}/Utilities
>>> ${ITK_SOURCE_DIR}/Utilities
>>> )
>>> @@ -149,6 +150,7 @@ SET(ITK_INCLUDE_RELATIVE_DIRS
>>> ${ITK_INCLUDE_RELATIVE_DIRS}
>>> Utilities/nifti/niftilib
>>> Utilities/nifti/znzlib
>>> Utilities/itkExtHdrs
>>> + Utilities/openjpeg
>>> Utilities
>>> )
>>>
>>>
>>> and if it works,
>>> please go ahead and push the change.
>>>
>>>
>>> Thanks
>>>
>>>
>>> Luis
>>>
>>>
>>> -----------------------------------------------------------
>>> 2010/8/28 Gaëtan Lehmann <gaetan.lehmann at jouy.inra.fr>
>>>
>>>
>>>> Le 28 août 10 à 00:53, Luis Ibanez a écrit :
>>>>
>>>>
>>>>> Hi Gaetan,
>>>>>
>>>>
>>>> Hi Luis,
>>>>
>>>>
>>>>
>>>>> Are you doing this with an installed version of ITK ?
>>>>>
>>>>
>>>> No, I'm using it in the build tree.
>>>>
>>>>
>>>>
>>>>> I just verified that I can use JPEG2000ImageIO
>>>>> from a small example outside of the ITK build tree.
>>>>>
>>>>> (Note that you must have configured ITK with
>>>>> ITK_USE_REVIEW ON).
>>>>>
>>>>
>>>> Yes, that's on.
>>>>
>>>>
>>>>
>>>>> Please let me know how I can reproduce the problem
>>>>> that you are observing.
>>>>>
>>>>
>>>> I'm trying to add JPEG2000ImageIO to wrapitk, but openjpeg.h can't be
>>>> found.
>>>> I have to add the path to this file in ITK_INCLUDE_DIRS in
>>>> ITKConfig.cmake
>>>>
>>>> Without this manual fix, I get the following error message:
>>>>
>>>> [ 80%] Generating wrap_ITKIOBase.xml
>>>> In file included from
>>>> /home/glehmann/src/tests/wrapitk/build/Libraries/IO/wrap_ITKIOBase.cxx:77:
>>>> /home/glehmann/src/tests/ITK/Code/Review/itkJPEG2000ImageIO.h:35:24:
>>>> error: openjpeg.h: No such file or directory
>>>> /home/glehmann/src/tests/ITK/Code/Review/itkJPEG2000ImageIO.h:36:19:
>>>> error: j2k.h: No such file or directory
>>>> /home/glehmann/src/tests/ITK/Code/Review/itkJPEG2000ImageIO.h:37:19:
>>>> error: jp2.h: No such file or directory
>>>> In file included from
>>>> /home/glehmann/src/tests/wrapitk/build/Libraries/IO/wrap_ITKIOBase.cxx:77:
>>>> /home/glehmann/src/tests/ITK/Code/Review/itkJPEG2000ImageIO.h:111:
>>>> error: 'opj_dparameters_t' does not name a type
>>>> /home/glehmann/src/tests/ITK/Code/Review/itkJPEG2000ImageIO.h:130:
>>>> error: ISO C++ forbids declaration of 'opj_codec_t' with no type
>>>> /home/glehmann/src/tests/ITK/Code/Review/itkJPEG2000ImageIO.h:130:
>>>> error: expected ';' before '*' token
>>>> /home/glehmann/src/tests/ITK/Code/Review/itkJPEG2000ImageIO.h:132:
>>>> error: 'OPJ_UINT32' does not name a type
>>>> /home/glehmann/src/tests/ITK/Code/Review/itkJPEG2000ImageIO.h:133:
>>>> error: 'OPJ_UINT32' does not name a type
>>>> /home/glehmann/src/tests/ITK/Code/Review/itkJPEG2000ImageIO.h:135:
>>>> error: 'OPJ_UINT32' does not name a type
>>>> /home/glehmann/src/tests/ITK/Code/Review/itkJPEG2000ImageIO.h:136:
>>>> error: 'OPJ_UINT32' does not name a type
>>>> /home/glehmann/src/tests/ITK/Code/Review/itkJPEG2000ImageIO.h:138:
>>>> error: 'OPJ_UINT32' does not name a type
>>>> /home/glehmann/src/tests/ITK/Code/Review/itkJPEG2000ImageIO.h:139:
>>>> error: 'OPJ_UINT32' does not name a type
>>>> /home/glehmann/src/tests/ITK/Code/Review/itkJPEG2000ImageIO.h: In member
>>>> function 'void itk::JPEG2000ImageIO::SetTileSize(int, int)':
>>>> /home/glehmann/src/tests/ITK/Code/Review/itkJPEG2000ImageIO.h:102:
>>>> error: 'm_TileWidth' was not declared in this scope
>>>> /home/glehmann/src/tests/ITK/Code/Review/itkJPEG2000ImageIO.h:103:
>>>> error: 'm_TileHeight' was not declared in this scope
>>>> make[3]: *** [Libraries/IO/wrap_ITKIOBase.xml] Erreur 1
>>>> make[2]: *** [Libraries/IO/CMakeFiles/IOIdx.dir/all] Erreur 2
>>>> make[1]: *** [Libraries/IO/CMakeFiles/IOPython.dir/rule] Erreur 2
>>>> make: *** [IOPython] Erreur 2
>>>>
>>>> Gaëtan
>>>>
>>>>
>>>>
>>>>
>>>>>
>>>>> Thanks
>>>>>
>>>>>
>>>>> Luis
>>>>>
>>>>>
>>>>> -------------------
>>>>> 2010/8/27 Gaëtan Lehmann <gaetan.lehmann at jouy.inra.fr>
>>>>>
>>>>> Hi,
>>>>>
>>>>> I found a small problem with openjpg: the include dir is not exported,
>>>>> and thus openjpeg.h can't be found while using JPEG2000ImageIO outside of
>>>>> the ITK build tree.
>>>>> I tried to fix that but I'm not sure how to do it right.
>>>>>
>>>>> It would be nice if someone used to how the utilities are managed in
>>>>> ITK can fix that!
>>>>>
>>>>> Thanks,
>>>>>
>>>>> Gaëtan
>>>>>
>>>>>
>>>>> --
>>>>> Gaëtan Lehmann
>>>>> Biologie du Développement et de la Reproduction
>>>>> INRA de Jouy-en-Josas (France)
>>>>> tel: +33 1 34 65 29 66 fax: 01 34 65 29 09
>>>>> http://voxel.jouy.inra.fr http://www.itk.org
>>>>> http://www.mandriva.org http://www.bepo.fr
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> Powered by www.kitware.com
>>>>>
>>>>> Visit other Kitware open-source projects at
>>>>> http://www.kitware.com/opensource/opensource.html
>>>>>
>>>>> Kitware offers ITK Training Courses, for more information visit:
>>>>> http://kitware.com/products/protraining.html
>>>>>
>>>>> Please keep messages on-topic and check the ITK FAQ at:
>>>>> http://www.itk.org/Wiki/ITK_FAQ
>>>>>
>>>>> Follow this link to subscribe/unsubscribe:
>>>>> http://www.itk.org/mailman/listinfo/insight-developers
>>>>>
>>>>>
>>>>>
>>>> --
>>>> Gaëtan Lehmann
>>>> Biologie du Développement et de la Reproduction
>>>> INRA de Jouy-en-Josas (France)
>>>> tel: +33 1 34 65 29 66 fax: 01 34 65 29 09
>>>> http://voxel.jouy.inra.fr http://www.itk.org
>>>> http://www.mandriva.org http://www.bepo.fr
>>>>
>>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/mailman/private/insight-developers/attachments/20100828/68596532/attachment.htm>
More information about the Insight-developers
mailing list