[vtkusers] vtk difference between Mac and Windows in Java

Jonathan Morra jonmorra at gmail.com
Wed Feb 16 19:42:11 EST 2011


I have the following function in Java

public vtkImageData getBlankBinaryImage() {
        vtkImageData image = ENV.getInstance().getDataLoader().getImage();
        vtkImageData blankImage = new vtkImageData();
        // Because of a bug in vtk, where the contour widget doesn't work if
        // the ROI goes all the way to the edge of the image, we're going to
        // increase the size of the image by 1 in each direction to take
care
        // of this
        int[] extent = image.GetExtent();
        extent[1]+=2;
        extent[3]+=2;
        extent[5]+=2;
        double[] origin = image.GetOrigin();
        double[] spacing = image.GetSpacing();
        blankImage.SetExtent(extent);
        blankImage.SetOrigin(origin);
        blankImage.SetSpacing(spacing);
        blankImage.SetScalarTypeToUnsignedChar();
        blankImage.AllocateScalars();
        return blankImage;
    }

My goal is to return a vtkImageData where all of the voxels are set to 0.
 On Windows this works fine, however, on Mac this doesn't.  How can I ensure
that all voxels have a value of 0 on any platform?

Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110216/a9584247/attachment.htm>


More information about the vtkusers mailing list