<div dir="ltr">Ok, I can reproduce the error with my sample code. I have to add writer->UseCompressionOn().<div><br></div><div>I think that also points out an error…</div><div><br></div><div>Now I can debug.</div></div>
<div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Dec 20, 2013 at 11:17 AM, Fethallah Benmansour <span dir="ltr"><<a href="mailto:fethallah@gmail.com" target="_blank">fethallah@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Bill,<div><br></div><div>Thanks again.</div><div>Your code works indeed, however the output image is not JPEG compressed as it should be:</div>
<div><br></div><div><img src="cid:ii_14310cbf040993f8" alt="Inline image 1"><br>
</div><div><br></div><div><br></div><div>Thanks for your help.</div><div><br></div><div>--</div><div>Fethallah</div></div><div class="gmail_extra"><br clear="all"><div><div>--</div>Fethallah <br></div><div><div class="h5">
<br><br><div class="gmail_quote">On Fri, Dec 20, 2013 at 5:06 PM, Bill Lorensen <span dir="ltr"><<a href="mailto:bill.lorensen@gmail.com" target="_blank">bill.lorensen@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Can you try this program:<br>
<br>
On Fri, Dec 20, 2013 at 11:03 AM, Fethallah Benmansour<br>
<div><div><<a href="mailto:fethallah@gmail.com" target="_blank">fethallah@gmail.com</a>> wrote:<br>
> 4.4.2<br>
> Let me know if you need more info, I can also send you my cxx and my<br>
> CMakelists.txt<br>
><br>
> Thanks,<br>
><br>
> --<br>
> Fethallah<br>
><br>
> --<br>
> Fethallah<br>
><br>
><br>
> On Fri, Dec 20, 2013 at 4:59 PM, Bill Lorensen <<a href="mailto:bill.lorensen@gmail.com" target="_blank">bill.lorensen@gmail.com</a>><br>
> wrote:<br>
>><br>
>> What version of ITK are you using?<br>
>><br>
>><br>
>> On Fri, Dec 20, 2013 at 10:56 AM, Fethallah Benmansour<br>
>> <<a href="mailto:fethallah@gmail.com" target="_blank">fethallah@gmail.com</a>> wrote:<br>
>> > Thanks Bill for your prompt reply.<br>
>> > I'm looking forward to hearing from you.<br>
>> ><br>
>> > --<br>
>> > Fethallah<br>
>> ><br>
>> > --<br>
>> > Fethallah<br>
>> ><br>
>> ><br>
>> > On Fri, Dec 20, 2013 at 4:50 PM, Bill Lorensen <<a href="mailto:bill.lorensen@gmail.com" target="_blank">bill.lorensen@gmail.com</a>><br>
>> > wrote:<br>
>> >><br>
>> >> I do not see any tests that use tiff compression. You may have founds<br>
>> >> a bug. I'll investigate.<br>
>> >><br>
>> >><br>
>> >> On Fri, Dec 20, 2013 at 10:35 AM, Fethallah <<a href="mailto:fethallah@gmail.com" target="_blank">fethallah@gmail.com</a>><br>
>> >> wrote:<br>
>> >> > Hi there,<br>
>> >> ><br>
>> >> > I would like to compress some relatively large tif files.<br>
>> >> ><br>
>> >> > My code looks like:<br>
>> >> > =================<br>
>> >> > ReaderType::Pointer reader = ReaderType::New();<br>
>> >> > reader->SetFileName( argv[1] );<br>
>> >> > reader->Update();<br>
>> >> ><br>
>> >> > WriterType::Pointer writer = WriterType::New();<br>
>> >> > writer->SetInput( reader->GetOutput() );<br>
>> >> > writer->SetFileName( argv[2] );<br>
>> >> > writer->SetUseCompression(true);<br>
>> >> > typedef itk::TIFFImageIO TIFFIOType;<br>
>> >> > TIFFIOType::Pointer tiffIO = TIFFIOType::New();<br>
>> >> > tiffIO->SetCompressionToJPEG();<br>
>> >> > writer->SetImageIO(tiffIO);<br>
>> >> > writer->Update();<br>
>> >> > =================<br>
>> >> > when I run<br>
>> >> > binary.exe Image.tif ImageCompressed.tif<br>
>> >> ><br>
>> >> > I'm getting the following exception:<br>
>> >> > JPEGLib: Bogus input colorspace.<br>
>> >> > itk::ExceptionObject (000000000012F6E8)<br>
>> >> > Location: "unknown"<br>
>> >> > File:<br>
>> >> ><br>
>> >> ><br>
>> >> > ..\..\..\..\..\src\InsightToolkit-4.4.2\Modules\IO\TIFF\src\itkTIFFImageIO.cxx<br>
>> >> > Line: 1946<br>
>> >> > Description: itk::ERROR: TIFFImageIO(00000000020D4420): TIFFImageIO:<br>
>> >> > error<br>
>> >> > out of disk space<br>
>> >> ><br>
>> >> ><br>
>> >> > The pixel type of the input images is UCHAR.<br>
>> >> ><br>
>> >> > An other question regarding JPG compression in TIF files, assuming<br>
>> >> > this<br>
>> >> > works with ITK.<br>
>> >> > Is there a way to control the compression rate ?<br>
>> >> ><br>
>> >> > Thanks into advance for your help.<br>
>> >> ><br>
>> >> ><br>
>> >> > --<br>
>> >> > Fethallah<br>
>> >> ><br>
>> >> ><br>
>> >> ><br>
>> >> ><br>
>> >> > --<br>
>> >> > View this message in context:<br>
>> >> ><br>
>> >> > <a href="http://itk-insight-users.2283740.n2.nabble.com/Compressing-Tif-files-tp7584685.html" target="_blank">http://itk-insight-users.2283740.n2.nabble.com/Compressing-Tif-files-tp7584685.html</a><br>
>> >> > Sent from the ITK Insight 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>
>> >> > Kitware offers ITK Training Courses, for more information visit:<br>
>> >> > <a href="http://www.kitware.com/products/protraining.php" target="_blank">http://www.kitware.com/products/protraining.php</a><br>
>> >> ><br>
>> >> > Please keep messages on-topic and check the ITK FAQ at:<br>
>> >> > <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
>> >> ><br>
>> >> > Follow this link to subscribe/unsubscribe:<br>
>> >> > <a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</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>
</div></div></blockquote></div><br></div></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Unpaid intern in BillsBasement at noware dot com<br>
</div>