Skip to content
Snippets Groups Projects
Commit 7312fb67 authored by Guillaume Pasero's avatar Guillaume Pasero
Browse files

BUG: no sample copied when numThreads is 1

parent 9e5a3bf5
No related branches found
No related tags found
No related merge requests found
......@@ -203,26 +203,22 @@ PersistentDescriptorsListSampleGenerator<TInputImage, TVectorData, TFunctionType
labelListSample->SetMeasurementVectorSize(m_ThreadLabelListSample[0]->GetMeasurementVectorSize());
// Copy the first thread elements into lists
if( this->GetNumberOfThreads() > 1 )
ListSampleType* threadListSample = m_ThreadListSample[0];
LabelListSampleType* threadLabelListSample = m_ThreadLabelListSample[0];
SamplesPositionType& threadSamplesPosition = m_ThreadSamplesPosition[0];
for (unsigned int i = 0; i < threadListSample->Size(); ++i)
{
ListSampleType* threadListSample = m_ThreadListSample[0];
LabelListSampleType* threadLabelListSample = m_ThreadLabelListSample[0];
SamplesPositionType& threadSamplesPosition = m_ThreadSamplesPosition[0];
for (unsigned int i = 0; i < threadListSample->Size(); ++i)
{
listSample->PushBack( threadListSample->GetMeasurementVector(i) );
labelListSample->PushBack( threadLabelListSample->GetMeasurementVector(i) );
samplesPosition.push_back( threadSamplesPosition[i] );
}
listSample->PushBack( threadListSample->GetMeasurementVector(i) );
labelListSample->PushBack( threadLabelListSample->GetMeasurementVector(i) );
samplesPosition.push_back( threadSamplesPosition[i] );
}
// Add the other thread element checking if the point dosn't already exist
for (itk::ThreadIdType threadId = 1; threadId < this->GetNumberOfThreads(); ++threadId )
{
ListSampleType* threadListSample = m_ThreadListSample[threadId];
LabelListSampleType* threadLabelListSample = m_ThreadLabelListSample[threadId];
SamplesPositionType& threadSamplesPosition = m_ThreadSamplesPosition[threadId];
threadListSample = m_ThreadListSample[threadId];
threadLabelListSample = m_ThreadLabelListSample[threadId];
threadSamplesPosition = m_ThreadSamplesPosition[threadId];
for (unsigned int i = 0; i < threadListSample->Size(); ++i)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment