Commit 938ba6a5 authored by Gaëlle USSEGLIO's avatar Gaëlle USSEGLIO

COMP : Fix std::min

parent 21a630c6
......@@ -144,8 +144,8 @@ private:
std::pair<unsigned long,unsigned long> line = lines[i];
std::pair<unsigned long,unsigned long> sample = samples[i];
int minSamples = std::min(sample.second, vectIm->GetLargestPossibleRegion().GetSize()[0]-1);
int minLines = std::min(line.second, vectIm->GetLargestPossibleRegion().GetSize()[1]-1);
unsigned long minSamples = std::min(sample.second, static_cast<unsigned long>(vectIm->GetLargestPossibleRegion().GetSize()[0]-1));
unsigned long minLines = std::min(line.second, static_cast<unsigned long>(vectIm->GetLargestPossibleRegion().GetSize()[1]-1));
unsigned long startL = line.first - originOffset_lines;
unsigned long sizeL = minLines - line.first + 1;
......
......@@ -113,10 +113,14 @@ SarBurstExtractionImageFilter<TImage>::GenerateOutputInformation()
}
long firstOutSample = static_cast<long>(std::max( static_cast<long>(m_SamplesRecord.first), originOffset_samples));
long secondOutSample = static_cast<long>(std::min(m_SamplesRecord.second, largestPossibleRegion.GetSize()[0] + originOffset_samples - 1));
long secondOutSample = static_cast<long>(std::min(static_cast<long>(m_SamplesRecord.second),
static_cast<long>(largestPossibleRegion.GetSize()[0] +
originOffset_samples - 1)));
long firstOutLine = static_cast<long>(std::max(static_cast<long>(m_LinesRecord.first), originOffset_lines));
long secondOutLine = static_cast<long>(std::min(m_LinesRecord.second, largestPossibleRegion.GetSize()[1] + originOffset_lines - 1));
long secondOutLine = static_cast<long>(std::min(static_cast<long>(m_LinesRecord.second),
static_cast<long>(largestPossibleRegion.GetSize()[1] +
originOffset_lines - 1)));
burstSize[0] = secondOutSample - firstOutSample + 1;
burstSize[1] = secondOutLine - firstOutLine + 1;
......
......@@ -124,8 +124,8 @@ SarDeburstImageFilter<TImage>::GenerateOutputInformation()
if((long)it->first<=lastInputLine && (long)it->second>=firstInputLine)
{
RecordType filteredRecord = *it;
filteredRecord.first = std::max((long)filteredRecord.first,firstInputLine);
filteredRecord.second = std::min((long)filteredRecord.second,lastInputLine);
filteredRecord.first = std::max(static_cast<long>(filteredRecord.first),firstInputLine);
filteredRecord.second = std::min(static_cast<long>(filteredRecord.second),lastInputLine);
filteredRecords.push_back(filteredRecord);
}
}
......@@ -150,8 +150,8 @@ SarDeburstImageFilter<TImage>::GenerateOutputInformation()
if (m_OnlyValidSample)
{
long minEnd = static_cast<long>(std::min(m_SamplesRecord.second,
largestPossibleRegion.GetSize()[0] + originOffset_samples-1));
long minEnd = static_cast<long>(std::min(static_cast<long>(m_SamplesRecord.second),
static_cast<long>(largestPossibleRegion.GetSize()[0] + originOffset_samples-1)));
long maxStart = static_cast<long>(std::max(static_cast<long>(m_SamplesRecord.first),
originOffset_samples));
deburstSize[0] = minEnd - maxStart + 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment