[Insight-users] Java Wraping
Luis Ibanez
luis.ibanez at kitware.com
Wed, 25 Feb 2004 14:35:32 -0500
Hi Alejandro,
It is nice to see that you are
using ITK so fast after the course :-)
The support for Java wrapping has been
commited to the repository and you can
use it now. Bill Hoffman and Brad King
did this in record time.
Make sure that you do:
1) Get a fresh checkout of ITK from CVS.
2) Get a fresh checkout of CSwig
3) When you configure ITK with CMake,
enable the variable:
ITK_CSWIG_JAVA
You will find a .java example under
Insight/Wrapping/CSwig/Tests/Java
cannyEdgeDetectionImageFilter.java
Its code looks like
import InsightToolkit.*;
// This example illustrates how C++ classes
// can be used from Java using SWIG.
// The Java class gets mapped onto the C++
// class and behaves as if it is a Java class.
public class cannyEdgeDetectionImageFilter {
public static void main(String argv[])
{
itkImageFileReaderF2_Pointer reader =
itkImageFileReaderF2.itkImageFileReaderF2_New();
itkCannyEdgeDetectionImageFilterF2F2_Pointer canny =
itkCannyEdgeDetectionImageFilterF2F2.itkCannyEdgeDetectionImageFilterF2F2_New();
itkRescaleIntensityImageFilterF2US2_Pointer rescaler =
itkRescaleIntensityImageFilterF2US2.itkRescaleIntensityImageFilterF2US2_New();
itkImageFileWriterUS2_Pointer writer =
itkImageFileWriterUS2.itkImageFileWriterUS2_New();
canny.SetInput(reader.GetOutput());
rescaler.SetInput(canny.GetOutput());
writer.SetInput(rescaler.GetOutput());
rescaler.SetOutputMinimum(0);
rescaler.SetOutputMaximum(65535);
reader.SetFileName("../../../../Testing/Data/Input/cthead1.png");
writer.SetFileName("./testout.png");
writer.Update();
}
}
Regards,
Luis
--------------------------------
Alejandro Canales Ochoa wrote:
> Hi
> Recently I attent a short curse of ITK in Medical Imaging 2004 at San Diego. Luis Ibaņez told us that a version of ITK with java wrappers will be public in a short time.
> I am working in an java app and I want to integrate ITK on it. Can anyone please give me an advice on how to do this, or how to I obtain the version of ITK with the java wrappers.
>
> Thanks in advance.
> AC
>
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>