[vtkusers] vtk 5.6.1 on a mac wrapped in Java

Sebastien Jourdain sebastien.jourdain at kitware.com
Thu Dec 2 08:02:20 EST 2010


Hi Mark,

did you try your windows (Java) binary on your mac to see if you get
the same behavior ?
Are you sure that on your mac, the filename provided to the reader are
correct ? (no space or special string ?)

Seb

On Thu, Dec 2, 2010 at 12:01 AM, Mark Roden <mmroden at gmail.com> wrote:
> Hi all,
>
> So I managed to get vtk 5.6.1 to work on a mac with java wrappings on
> (10.6.5) and with gdcm.
>
> The following code is producing errors that I don't see on windows:
>
>               IPPSorter sorter = new IPPSorter();
>                sorter.SetComputeZSpacing(true);
>                sorter.SetZSpacingTolerance(0.000001);
>                Boolean sorted = sorter.Sort(theSeriesFiles);
>                //sorter.Sort(ft);
>
>                //have to make a vtk string array
>                FilenamesType sortedFT = sorter.GetFilenames();
>                long theSize = sortedFT.size();
>                vtkStringArray sa = new vtkStringArray();
>                for (int j = 0; j < theSize; j++) {
>                    String theString2 = sortedFT.get(j);
>                    sa.InsertNextValue(sortedFT.get(j));
>                }
>                gdcmReader.SetFileNames(sa);
>
>                gdcmReader.Update();
>
>                imageData = gdcmReader.GetOutput();
>
>                //make sure that we're getting spacing and orientation info
>                double[] spacing = imageData.GetSpacing();
>                spacing[2] = sorter.GetZSpacing();
>                imageData.SetSpacing(spacing);
>                double[] origin = imageData.GetOrigin();
>                double[] bounds = imageData.GetBounds();
>                double[] extraOrigin = {0,0,0};//because vtk will only
> flip about 0,0,0
>
>                vtkImageChangeInformation imageSpacingChange = new
> vtkImageChangeInformation();
>                imageSpacingChange.SetInput(imageData);
>                imageSpacingChange.SetOutputSpacing(spacing[0],
> spacing[1], spacing[2]);
>                imageSpacingChange.SetOutputOrigin(extraOrigin);
>                imageSpacingChange.Update();
>
> Once the last line is hit, the following error is reported in netbeans:
>
> ERROR: In /Users/mmroden/Documents/src/vtk-5.6.1/VTK-5.6.1/Filtering/vtkDemandDrivenPipeline.cxx,
> line 802
> vtkStreamingDemandDrivenPipeline (0x135884c10): Input for connection
> index 0 on input port index 0 for algorithm
> vtkImageChangeInformation(0x1358853c0) is NULL, but a vtkImageData is
> required.
>
> This code works perfectly well in Windows, and the spacing, origin,
> and bounds arrays all match the values in windows when loading the
> same series there.  So, I know that the gdcm side of things is
> working, at least to the point that those arrays are being reported
> correctly.
>
> Because the pipeline is breaking there, nothing else is working.  What
> can I do to fix it?
>
> Thanks,
> Mark
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>



More information about the vtkusers mailing list