damian-666 / b-tk

Automatically exported from code.google.com/p/b-tk
0 stars 0 forks source link

bug in btkMergeAcquisitionFilter.cpp #84

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
In Code/BasicFilters/btkMergeAcquisitionFilter.cpp, lines 241-253

===== Begin Code =====
 // Final check
        btk::Acquisition::Pointer input = in->Clone();
        // Check units
        if ((output->GetPointUnit(Point::Scalar).compare(input->GetPointUnit(Point::Scalar)) != 0)
            || (output->GetPointUnit(Point::Angle).compare(input->GetPointUnit(Point::Angle)) != 0)
            || (output->GetPointUnit(Point::Force).compare(input->GetPointUnit(Point::Force)) != 0)
            || (output->GetPointUnit(Point::Moment).compare(input->GetPointUnit(Point::Moment)) != 0)
            || (output->GetPointUnit(Point::Power).compare(input->GetPointUnit(Point::Power)) != 0)
            || (output->GetPointUnit(Point::Scalar).compare(input->GetPointUnit(Point::Scalar)) != 0))
        {
          btkWarningMacro("Input #" + ToString(idx) + " is not merged: Units do not correspond.");
          continue;
        }
===== End Code =====

The output units were set from the first input, and the code above checks to 
make sure all subsequent inputs have the same units as the output.

It has a bug: Unit correspondence is checked twice for Point::Scalar and not at 
all
for Point::Marker.

Original issue reported on code.google.com by tesch.be...@gmail.com on 16 Jan 2015 at 6:04

Attachments: