Skip to content

Commit 598e65f

Browse files
committed
Fixed bug with new TissueSegmentation #223 : frameData being overriden
1 parent 43ff9f9 commit 598e65f

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

source/FAST/Algorithms/ImagePatch/PatchGenerator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ void PatchGenerator::execute() {
348348

349349
if(mInputConnections.count(1) > 0) {
350350
// If a mask was given store it
351-
m_inputMask = getInputData<Image>(1);
351+
m_inputMask = getInputData<Image>(1, false);
352352
}
353353

354354
startStream();

source/FAST/ProcessObject.hpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ class FAST_EXPORT ProcessObject : public AttributeObject {
194194
void createOutputPort(uint portID);
195195

196196
template <class DataType>
197-
std::shared_ptr<DataType> getInputData(uint portID = 0);
197+
std::shared_ptr<DataType> getInputData(uint portID = 0, bool readFrameData = true);
198198
void addOutputData(DataObject::pointer data, bool propagateLastFrameData = true, bool propagateFrameData = true);
199199
void addOutputData(uint portID, DataObject::pointer data, bool propagateLastFrameData = true, bool propagateFrameData = true);
200200

@@ -269,7 +269,7 @@ void ProcessObject::createOutputPort(uint portID) {
269269
}
270270

271271
template<class DataType>
272-
std::shared_ptr<DataType> ProcessObject::getInputData(uint portID) {
272+
std::shared_ptr<DataType> ProcessObject::getInputData(uint portID, bool readFrameData) {
273273
validateInputPortExists(portID);
274274
DataChannel::pointer port = mInputConnections.at(portID);
275275
DataObject::pointer data = port->getNextFrame();
@@ -280,10 +280,12 @@ std::shared_ptr<DataType> ProcessObject::getInputData(uint portID) {
280280
throw BadCastException(data->getNameOfClass(), DataType::getStaticNameOfClass());
281281

282282
// Store frame data for this input data so it can be added to output data later
283-
for(auto&& lastFrame : data->getLastFrame())
284-
m_lastFrame.insert(lastFrame);
285-
for(auto&& frameData : data->getFrameData())
286-
m_frameData[frameData.first] = frameData.second;
283+
if(readFrameData) {
284+
for(auto&& lastFrame : data->getLastFrame())
285+
m_lastFrame.insert(lastFrame);
286+
for(auto&& frameData : data->getFrameData())
287+
m_frameData[frameData.first] = frameData.second;
288+
}
287289

288290
return convertedData;
289291
}

0 commit comments

Comments
 (0)