<div dir="ltr">Hi Francisco,<div><br></div><div>The vtkHull and vtkDelaunay3D classes require vtkPolyData as input. I suspect that you need vtkImageMarchingCubes or vtkContourFilter.</div><div><br></div><div>However, the output of these filters cannot be written to a NIFTI file. In fact, I'm a bit confused when you say "write a convex hull to a NIFTI file". A convex hull is a geometrical surface (e.g. made of polygons), but NIFTI is an image file format.</div><div><br></div><div> - David</div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, May 25, 2015 at 6:35 AM, Francisco Lopez de la Franca <span dir="ltr"><<a href="mailto:franciscolopezdelafranca@gmail.com" target="_blank">franciscolopezdelafranca@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"><div><div><div><div><div><div>Hi.<br></div>Thanks a lot. I've just downloaded VTK 6.2.0 and I've realised that there it is what I need.<br></div>But, I take advantage of this moment to tell about another problem.<br><br></div>I read a NIFTI file (abc.nii) through vtkNIFTIImageReader. Its output is passed to either vtkHull or vtkDelaunay3D in order to get the convex hull of the objects in the Nifti image.<br><br></div>And, in the end, I write their result with vtkNIFTIImageWriter.<br><br></div>The compilation goes right, but the execution (on a Windows system) does not produce anything and I hardly see a "command prompt" window flashing only once, but I am unable to read its content.<br><br></div>I think there must be some incompatibility between the output of vtkNifitiImageReader and the input to vtkHull or vtkDelaunay3D, or something similar.<br><br><div><div>Any suggestion on how to read a NIFTI file and get its convex hull and then write it to another Nifti file.<br><br></div><div>Thank you very much.<span><font color="#888888"><br></font></span></div><span><font color="#888888"><div>/Francisco<br></div></font></span></div></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">2015-05-25 14:25 GMT+02:00 David Gobbi <span dir="ltr"><<a href="mailto:david.gobbi@gmail.com" target="_blank">david.gobbi@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Francisco,<div><br></div><div>The vtkNIFTIImageReader did not appear until VTK 6.2.</div><div>There are two options that I can recommend:</div><div><br></div><div>1) Use the VTK git master, which has the most recent update to the NIFTI reader (the vtkNIFTIImageReader in VTK 6.2 gives the wrong sform offset in some situations, this is fixed in git master).</div><div><br></div><div>2) If you want to keep the VTK you have, then you can get the NIFTI reader separately by building the vtk-dicom package: <a href="https://github.com/dgobbi/vtk-dicom" target="_blank">https://github.com/dgobbi/vtk-dicom</a> (the class is called "vtkNIFTIReader" in vtk-dicom, but is otherwise identical to the one in the VTK git master branch).</div><div><br></div><div>Cheers,</div><div> - David </div><div><div><div><br></div><div><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, May 25, 2015 at 1:54 AM, Francisco Lopez de la Franca <span dir="ltr"><<a href="mailto:franciscolopezdelafranca@gmail.com" target="_blank">franciscolopezdelafranca@gmail.com</a>></span> wrote:<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"><div dir="ltr"><div><div><div><div><div><div><div><div>Hi everybody.<br></div>I'd like to read a NIFTI image from VTK.<br></div>I downloaded and compiled VTK 6.1.0, but when I include the vtkNIFTIImageReader header file, the compilation gives the error "No such file or directory".<br></div>I've searched for the header file into the VTK directory and it is true, there is no such a file.<br><br></div><div>I've tested with vtkImageReader2 and compilation goes fine, but the NIFTI file read does not seem to go well.<br></div><div><br></div>Does anybody know what the problem could be?<br><br></div>Thanks a lot.<br></div>My best regards.<br></div>/Francisco<br><br></div>P.D.: My CMakeLists.txt contains the next lines:<br><br>cmake_minimum_required(VERSION 2.8)<br><br>project(CV_TFM_CONVEX_HULL)<br><br># Find VTK.<br>find_package(VTK REQUIRED)<br>include(${VTK_USE_FILE})<br><br>set(CV_TFM_CONVEX_HULL_SRC CV_TFM_ConvexHull.cxx)<br><br>add_executable(CV_TFM_CONVEX_HULL ${CV_TFM_CONVEX_HULL_SRC})<br><br>target_link_libraries(CV_TFM_CONVEX_HULL ${VTK_LIBRARIES})<br></div>
<br></blockquote></div><br></div></div></div></div></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div></div>