Thursday, April 19, 2007

Connectivity issues

MAF has an operation that, given a single mesh extracted from segmentation, extracts all the connected polydata.
This operation wrap the vtkPolyDataConnectivityFilter:
The filter supports six working-modality, e.g. EXTRACT_ALL, EXTRACT_SELECTED, EXTRACT_LARGEST but unfortunately, this filter cannot cache the connectivity analisys. So that if you want to iteratively exctract all the connected surfaces, the filter hangs the PC, as well documented in the vtkUserList

Hi Rene-

This is a very good question and I can see why you would want to do this.
What comes to mind is to modify the connectivity filter so that it provides
additional information: cells in a certain region could be marked with
the number of cells in that region. Then a threshold operation
could be performed to extract the cells in regions that are big enough
for your purposes. It looks like this would be really easy to add....
there is already an array of sizes computed in the filter.
It would just have to be sent to the output.

Another approach is to have the connectivity filter only output regions
that are large enough based on a user-specified size.

I'm hoping that you can code this up (or find someone to do it);
otherwise we'll put it on the list and add the feature when time permits.

Will

At 08:52 PM 9/3/2002 +0200, Rene Tschirley wrote:
>Dear VTK experts,
>
>
>My application visualizes medical data (CT). After reading the slices
and creating an isosurface with vtkImageMarchingCubes (e.g. bone surface)
I'd like to drop all small regions which do not have at least 1% of the
overall polygon number. vtkPolyDataConnectivity is able to do this, but
my algorithm is terribly slow and I'd like to know if there's a better
way for my purpose:
> vtkPolyDataConnectivityFilter *connectFilter =
> vtkPolyDataConnectivityFilter::New();
>
> connectFilter->SetInput(mesh);
> connectFilter->SetExtractionModeToAllRegions();
> connectFilter->Update();
> connectFilter->SetExtractionModeToSpecifiedRegions();
>
> for (int i=0; iGetNumberOfExtractedRegions(); i++)
> {
> connectFilter->AddSpecifiedRegion(i);
> connectFilter->Update();
>
> cerr << "Region " <<>> connectFilter->GetOutput()->GetNumberOfPolys()
<< " polys.\n"; > // if region shall be dropped
> if (1) connectFilter->DeleteSpecifiedRegion(i);
> }
>
>
>Creating an isosurface with level 1200 on the head of the visible human
female dataset creates about 170 regions. The speed of the code makes me
believe that the ConnectivityFilter doesn't cache the connectivity information
and neither checks if the input data has changed (and it has to recalculate
the connectivities) nor if a change of the extraction mode makes
recalculation neccessary. That would save me about 170 times the single
calculation speed and would be great!
>
>Is there a way of creating a bunch of vtkPolyData objects, one
for each objects, with a single cycle?
>
>
>Best regards,
> René
>
>--
One improvement can consist into calling the connectivityFilter->InitializeSpecifiedRegionList() instead of the for loop that deletes the already extracted regions (that requires a further call to the update filter).

Wednesday, April 18, 2007

how to fill holes in vtk

http://www.bioengineering-research.com/vtk/vtkTesselateBoundaryLoops.htm

http://public.kitware.com/pipermail/vtkusers/2006-April/084724.html

Linux

Ultima scoperta sul fronte Linux:
le wx 2.6.3 accettano solo le gtk 2 e non quelle inferiori.

Questo impedisce di testare le gtk 1.2 con wxWindows per cercare di risolvere il problema dell'apertura di più viste contemporaneamente.

Tuesday, April 17, 2007

post 1.0

this blog contains any (good, bad, extremely verbose or very short) comments, thoughts, idea on MAF development.
For those few that don't know what a hell MAF is, MAF is an opensource c++ framework aimed to rapidly develop scientific visualization applications.

Ah sorry, as the main topic, also this blog is in beta version...