<div dir="ltr"><p dir="ltr">These are very large files. Try reading just 2 or 3</p><p dir="ltr"><span style="color:rgb(0,0,0);font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px">TIFFReader -> SetDataExtent(0,653,0,3959,0,2</span><span style="color:rgb(0,0,0);font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px">); </span><br>
</p>
<div class="gmail_quote">On Jun 19, 2014 7:06 PM, "Matheus Viana" <<a href="mailto:vianamp@gmail.com" target="_blank">vianamp@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div dir="ltr"><div><span style="color:rgb(0,0,0);font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px">Hi Bill, this is the code. </span><span style="font-size:13px;color:rgb(0,0,0);font-family:Verdana,Geneva,Helvetica,Arial,sans-serif">I also tried to comments the lines related to </span><span style="font-size:12.727272033691406px;color:rgb(0,0,0);font-family:Verdana,Geneva,Helvetica,Arial,sans-serif">SetDataByteOrderToBigEndian and </span><span style="font-size:12.727272033691406px;color:rgb(0,0,0);font-family:Verdana,Geneva,Helvetica,Arial,sans-serif">SetDataScalarTypeToUnsignedShort, but they don't make any difference.</span></div>
<div><span style="color:rgb(0,0,0);font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px"><br></span></div><span style="color:rgb(0,0,0);font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px">int main() { </span><br style="color:rgb(0,0,0);font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px">
<span style="color:rgb(0,0,0);font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px"> vtkTIFFReader *TIFFReader = vtkTIFFReader::New(); </span><br style="color:rgb(0,0,0);font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px">
<span style="color:rgb(0,0,0);font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px"> TIFFReader -> SetDataByteOrderToBigEndian(); </span><br style="color:rgb(0,0,0);font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px">
<span style="color:rgb(0,0,0);font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px"> TIFFReader -> SetDataExtent(0,653,0,3959,0,3959); </span><br style="color:rgb(0,0,0);font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px">
<span style="color:rgb(0,0,0);font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px"> TIFFReader -> SetFilePrefix("/Users/matheusviana/Desktop/images/im"); </span><br style="color:rgb(0,0,0);font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px">
<span style="color:rgb(0,0,0);font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px"> TIFFReader -> SetFilePattern("%s%04d.tif"); </span><br style="color:rgb(0,0,0);font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px">
<span style="color:rgb(0,0,0);font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px"> TIFFReader -> SetDataScalarTypeToUnsignedShort(); </span><br style="color:rgb(0,0,0);font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px">
<span style="color:rgb(0,0,0);font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px"> TIFFReader -> Update(); </span><br style="color:rgb(0,0,0);font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px">
<span style="color:rgb(0,0,0);font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px"> </span><br style="color:rgb(0,0,0);font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px"><span style="color:rgb(0,0,0);font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px"> vtkStructuredPointsWriter *ImageDataWriter = vtkStructuredPointsWriter::New(); </span><br style="color:rgb(0,0,0);font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px">
<span style="color:rgb(0,0,0);font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px"> ImageDataWriter -> SetFileType(VTK_BINARY); </span><br style="color:rgb(0,0,0);font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px">
<span style="color:rgb(0,0,0);font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px"> ImageDataWriter -> SetInput(TIFFReader -> GetOutput()); </span><br style="color:rgb(0,0,0);font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px">
<span style="color:rgb(0,0,0);font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px"> ImageDataWriter -> SetFileName("Result.vtk"); </span><br style="color:rgb(0,0,0);font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px">
<span style="color:rgb(0,0,0);font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px"> ImageDataWriter -> Write(); </span><br style="color:rgb(0,0,0);font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px">
<br style="color:rgb(0,0,0);font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px"><span style="color:rgb(0,0,0);font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px"> return 1; </span><br style="color:rgb(0,0,0);font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px">
<span style="color:rgb(0,0,0);font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px">}</span><br></div><div class="gmail_extra"><br clear="all"><div><div><div><font color="#555555" face="Helvetica, Arial, sans-serif"><span style="line-height:16px"><b>Matheus Viana</b></span></font></div>
<div><font color="#555555" face="Helvetica, Arial, sans-serif"><span style="line-height:16px"><b>Postdoctoral Research Employee</b></span></font></div><div><b><span style="color:rgb(85,85,85);line-height:16px;font-family:Helvetica,Arial,sans-serif;font-size:13px">Developmental and Cell Biology</span></b></div>
<div><font color="#555555" face="Helvetica, Arial, sans-serif"><span style="line-height:16px"><b>University of California Irvine</b></span></font></div><div><font color="#555555" face="Helvetica, Arial, sans-serif"><span style="line-height:16px"><b><br>
</b></span></font><b><i><br></i></b></div></div></div>
<br><br><div class="gmail_quote">2014-06-19 18:46 GMT-03:00 Bill Lorensen <span dir="ltr"><<a href="mailto:bill.lorensen@gmail.com" target="_blank">bill.lorensen@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
Please post your updated code.<br>
<div><div><br>
<br>
On Thu, Jun 19, 2014 at 4:56 PM, Matheus Viana <<a href="mailto:vianamp@gmail.com" target="_blank">vianamp@gmail.com</a>> wrote:<br>
> I got the same result, blank file.<br>
><br>
> Matheus Viana<br>
> Postdoctoral Research Employee<br>
> Developmental and Cell Biology<br>
> University of California Irvine<br>
><br>
><br>
><br>
><br>
> 2014-06-19 17:35 GMT-03:00 Bill Lorensen <<a href="mailto:bill.lorensen@gmail.com" target="_blank">bill.lorensen@gmail.com</a>>:<br>
><br>
>> So, lets say each image is 512 x 512, and you have 3960 images,<br>
>> TIFFReader -> SetDataExtent(0,511,0,511,0,3959);<br>
>><br>
>> On Thu, Jun 19, 2014 at 3:29 PM, Matheus Viana <<a href="mailto:vianamp@gmail.com" target="_blank">vianamp@gmail.com</a>> wrote:<br>
>> > They are in separate files.<br>
>> ><br>
>> > Matheus Viana<br>
>> > Postdoctoral Research Employee<br>
>> > Developmental and Cell Biology<br>
>> > University of California Irvine<br>
>> ><br>
>> ><br>
>> ><br>
>> ><br>
>> > 2014-06-19 16:21 GMT-03:00 Bill Lorensen <<a href="mailto:bill.lorensen@gmail.com" target="_blank">bill.lorensen@gmail.com</a>>:<br>
>> ><br>
>> >> Are the images all in one file? Or separate files for each image?<br>
>> >><br>
>> >><br>
>> >> On Thu, Jun 19, 2014 at 1:56 PM, Matheus Viana <<a href="mailto:vianamp@gmail.com" target="_blank">vianamp@gmail.com</a>><br>
>> >> wrote:<br>
>> >> > Dear David,<br>
>> >> ><br>
>> >> > I tried to use XMLImageDataWriter and it seems to be working.<br>
>> >> > However,<br>
>> >> > the<br>
>> >> > original VTK file that has 2Gb is then saved as a vti file that has<br>
>> >> > only<br>
>> >> > 10Mb. I think this is fine because my data is very sparse with a lot<br>
>> >> > of<br>
>> >> > zeros. I can make sure that it is working well because Paraview<br>
>> >> > crashes<br>
>> >> > when<br>
>> >> > I tried to load the file. I'll check it again later on. Anyway, do<br>
>> >> > you<br>
>> >> > think<br>
>> >> > the bug is in the StructuredPointsWriter?<br>
>> >> ><br>
>> >> > Bill, I tried to not specify the data extent, but in this case the<br>
>> >> > reader<br>
>> >> > reads only the first image of the sequence. Is there anything else I<br>
>> >> > have to<br>
>> >> > set up?<br>
>> >> ><br>
>> >> > Matheus Viana<br>
>> >> > Postdoctoral Research Employee<br>
>> >> > Developmental and Cell Biology<br>
>> >> > University of California Irvine<br>
>> >> ><br>
>> >> ><br>
>> >> ><br>
>> >> ><br>
>> >> > 2014-06-19 14:20 GMT-03:00 Bill Lorensen <<a href="mailto:bill.lorensen@gmail.com" target="_blank">bill.lorensen@gmail.com</a>>:<br>
>> >> ><br>
>> >> >> The data extents you specified will produce a zero length structured<br>
>> >> >> points.<br>
>> >> >><br>
>> >> >> For the tiff reader, you need not specify the extents if you want<br>
>> >> >> all<br>
>> >> >> of the data. And I'm not sure what the other methods will do in the<br>
>> >> >> tiff reader.<br>
>> >> >> vtkTIFFReader *TIFFReader = vtkTIFFReader::New();<br>
>> >> >> TIFFReader -><br>
>> >> >> SetFilePrefix("/Users/matheusviana/Desktop/images/im");<br>
>> >> >> TIFFReader -> SetFilePattern("%s%04d.tif");<br>
>> >> >> TIFFReader -> Update();<br>
>> >> >><br>
>> >> >> On Thu, Jun 19, 2014 at 8:14 AM, matheus_viana <<a href="mailto:vianamp@gmail.com" target="_blank">vianamp@gmail.com</a>><br>
>> >> >> wrote:<br>
>> >> >> > Guys, I'd like to know if there is any error in this code below.<br>
>> >> >> > The<br>
>> >> >> > code<br>
>> >> >> > works fine for small size dataset, but it writes a blank file when<br>
>> >> >> > the<br>
>> >> >> > dataset has more than 2Gb. I'm working on 64bit OSX.<br>
>> >> >> ><br>
>> >> >> > Thanks a lot.<br>
>> >> >> ><br>
>> >> >> > int main() {<br>
>> >> >> > vtkTIFFReader *TIFFReader = vtkTIFFReader::New();<br>
>> >> >> > TIFFReader -> SetDataByteOrderToBigEndian();<br>
>> >> >> > TIFFReader -> SetDataExtent(0,0,0,0,0,3959);<br>
>> >> >> > TIFFReader -><br>
>> >> >> > SetFilePrefix("/Users/matheusviana/Desktop/images/im");<br>
>> >> >> > TIFFReader -> SetFilePattern("%s%04d.tif");<br>
>> >> >> > TIFFReader -> SetDataScalarTypeToUnsignedShort();<br>
>> >> >> > TIFFReader -> Update();<br>
>> >> >> ><br>
>> >> >> > vtkStructuredPointsWriter *ImageDataWriter =<br>
>> >> >> > vtkStructuredPointsWriter::New();<br>
>> >> >> > ImageDataWriter -> SetFileType(VTK_BINARY);<br>
>> >> >> > ImageDataWriter -> SetInput(TIFFReader -> GetOutput());<br>
>> >> >> > ImageDataWriter -> SetFileName("Result.vtk");<br>
>> >> >> > ImageDataWriter -> Write();<br>
>> >> >> ><br>
>> >> >> > return 1;<br>
>> >> >> > }<br>
>> >> >> ><br>
>> >> >> ><br>
>> >> >> ><br>
>> >> >> > --<br>
>> >> >> > View this message in context:<br>
>> >> >> ><br>
>> >> >> ><br>
>> >> >> > <a href="http://vtk.1045678.n5.nabble.com/vtkStructuredPointsWriter-writes-a-blank-file-tp5727536.html" target="_blank">http://vtk.1045678.n5.nabble.com/vtkStructuredPointsWriter-writes-a-blank-file-tp5727536.html</a><br>
>> >> >> > Sent from the VTK - Users mailing list archive at Nabble.com.<br>
>> >> >> > _______________________________________________<br>
>> >> >> > Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
>> >> >> ><br>
>> >> >> > Visit other Kitware open-source projects at<br>
>> >> >> > <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
>> >> >> ><br>
>> >> >> > Please keep messages on-topic and check the VTK FAQ at:<br>
>> >> >> > <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
>> >> >> ><br>
>> >> >> > Follow this link to subscribe/unsubscribe:<br>
>> >> >> > <a href="http://public.kitware.com/mailman/listinfo/vtkusers" target="_blank">http://public.kitware.com/mailman/listinfo/vtkusers</a><br>
>> >> >><br>
>> >> >><br>
>> >> >><br>
>> >> >> --<br>
>> >> >> Unpaid intern in BillsBasement at noware dot com<br>
>> >> ><br>
>> >> ><br>
>> >><br>
>> >><br>
>> >><br>
>> >> --<br>
>> >> Unpaid intern in BillsBasement at noware dot com<br>
>> ><br>
>> ><br>
>><br>
>><br>
>><br>
>> --<br>
>> Unpaid intern in BillsBasement at noware dot com<br>
><br>
><br>
<br>
<br>
<br>
--<br>
Unpaid intern in BillsBasement at noware dot com<br>
</div></div></blockquote></div><br></div>
</blockquote></div>
</div>