Hello OTB team,

I have been using the ImageSampleExtractorFilter, and its superclass 
PersistentSamplingFilterBase, and I have a few questions concerning these 
classes.

1. What is the point of the "FieldName" attribute ? 

otbPersistentSamplingFilterBase.h lines 81-84
/** Set/Get macro for the field name containing class names * in the input 
vectors.*/ 
itkSetMacro(FieldName, std::string);
itkGetMacro(FieldName, std::string);

It is only called once, and basically raises an error if the field isn't 
present in the output shapefile..

otbPersistentSamplingFilterBase.hxx lines 118-123

int fieldIndex = featIt->ogr().GetFieldIndex(this->m_FieldName.c_str());
 if (fieldIndex < 0) {
 itkGenericExceptionMacro("Field named "<<this->m_FieldName<<" not found!");
} 
this->m_FieldIndex = fieldIndex; 


The m_FieldIndex attribute is not called anywhere else except for in these 
lines.. It seems totally useless !

I do not understand why the filter requires the user to give the name of 
one of the fields in the output shapefile for the sample extraction step 
anyway. The filter and the application should work even if the output 
shapefile contains no fields at all. This is also quite inconvenient for 
anyone inheriting this class, as they are also required to give a field 
name.

2. The PersistentSamplingFilterBase provides a "ProcessSample" method that 
should be overriden by a child class, and that should define the function to 
apply to each sample in the shapefile.
However, the ImageSampleExtractorFilter does everything in the 
ThreadedGenerateData. Why not use the ProcessSample method ?

Thank you,

Dawa

-- 
-- 
Check the OTB FAQ at
http://www.orfeo-toolbox.org/FAQ.html

You received this message because you are subscribed to the Google
Groups "otb-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/otb-users?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"otb-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to