Closed heffter closed 10 years ago
@Chaircrusher Kent Please attempt to resolve these issues ASAP for BRAINSTools, ANTS, and Teem. If you need me to merge items into ANTS, please let me know.
I know that you can not build on windows, but try to resolve these windows based failures using the notes above on your mac/linux computers. Then request that @heffter rebuild.
Thanks, Hans
You can download VirtualBox (www.virtualbox.org) image from Microsoft for free from here: https://www.modern.ie/en-us/virtualization-tools You can also download VS2010 SP1 and use it for 30 days. Hope it helps.
I made the changes and they appear to compile. The problem I ran into fixing this is that in trying to compile, the current version of ANTs and ITK clashes with the ANTSRegistrationHelper.
The changes for ANTs: diff --git a/Examples/ImageMath.cxx b/Examples/ImageMath.cxx index c772e68..6bb773e 100644 --- a/Examples/ImageMath.cxx +++ b/Examples/ImageMath.cxx @@ -14877,7 +14877,7 @@ private: { MajorityVoting<3>(argc, argv); }
+ This file is part of ASHS
ASHS is free software: you can redistribute it and/or modify @@ -15,22 +15,22 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
=================================================================== + CITATION:
This program implements the method described in the paper
"Multi-atlas segmentation with joint label fusion," IEEE Trans. on Pattern Analysis and Machine Intelligence, 35(3), 611-623, 2013
=================================================================== */
+
@@ -102,9 +102,9 @@ template<class TInputImage, class TOutputImage> void WeightedVotingLabelFusionImageFilter<TInputImage, TOutputImage> ::ComputeOffsetTable(
@@ -209,7 +209,7 @@ WeightedVotingLabelFusionImageFilter<TInputImage, TOutputImage> m_PosteriorMap[*sit]->FillBuffer(0.0f); }
m_VotingWeight[i]->FillBuffer(0.0f);
} } PosteriorImagePtr countermap = PosteriorImage::New(); @@ -252,7 +252,7 @@ WeightedVotingLabelFusionImageFilter<TInputImage, TOutputImage> apd[i] = new InputImagePixelType[nPatch * m_Modality];
// Also an array of pointers to the segmentations of different atlases
const InputImagePixelType *patchSeg = new const InputImagePixelType[n];
// Create an array for storing the normalized target patch to save more time InputImagePixelType _xNormTargetPatch = new InputImagePixelType[nPatch * mModality]; @@ -287,7 +287,7 @@ WeightedVotingLabelFusionImageFilter<TInputImage, TOutputImage> for(unsigned int i = 0; i < nPatch; i++) xNormTargetPatch[toff + i] = ((pTargetCurrent + offPatchTarget[i]) - mu) / sigma; }
+ // In each atlas, search for a patch that matches our patch for(int i = 0; i < n; i++) { @@ -296,7 +296,7 @@ WeightedVotingLabelFusionImageFilter<TInputImage, TOutputImage> int offPatch = offPatchAtlas[i], offSearch = offSearchAtlas[i];
const InputImageType *tatlas = m_Atlases[toff];
+ // Get the requested region for the tatlas RegionType rr = tatlas->GetRequestedRegion();
@@ -316,8 +316,13 @@ WeightedVotingLabelFusionImageFilter<TInputImage, TOutputImage> const InputImagePixelType _bestMatchPtr = new const InputImagePixelType [m_Modality]; const InputImagePixelType _tMatchPtr = new const InputImagePixelType [m_Modality];
InputImagePixelType *MatchSSQ = new InputImagePixelType[m_Modality];
int bestK = 0; for(unsigned int k = 0; k < nSearch; k++) @@ -377,15 +382,22 @@ WeightedVotingLabelFusionImageFilter<TInputImage, TOutputImage>
// Store the best found neighborhood patchSeg[i] = (bestMatchPtr[0] - m_Atlases[toff]->GetBufferPointer()) + seg->GetBufferPointer();
delete [] MatchSSQ;
}
// Allocate Mx MatrixType Mx(n, n);
// Now we can compute Mx
for(int k = 0; k <= i; k++)
{
// Multiply through the apd arrays
InputImagePixelType mxval = 0.0;
@@ -393,7 +405,7 @@ WeightedVotingLabelFusionImageFilter<TInputImage, TOutputImage> mxval += apd[i][m] * apd[k][m];
mxval /= (nPatch - 1);
+ if(m_Beta == 2) mxval *= mxval; else @@ -498,7 +510,7 @@ WeightedVotingLabelFusionImageFilter<TInputImage, TOutputImage> // Clear posterior maps if(!m_RetainPosteriorMaps) m_PosteriorMap.clear();
+ for(OutIter it(this->GetOutput(), this->GetOutput()->GetBufferedRegion()); !it.IsAtEnd(); ++it) { IndexType idx = it.GetIndex(); @@ -517,7 +529,7 @@ WeightedVotingLabelFusionImageFilter<TInputImage, TOutputImage> { for (int i=0; i < n; i++) m_VotingWeight[i]->SetPixel(idx,m_VotingWeight[i]->GetPixel(idx)/countermap->GetPixel(idx));
@@ -544,7 +556,7 @@ WeightedVotingLabelFusionImageFilter<TInputImage, TOutputImage>
/**
this->m_DeltaTriangularPointA[1] = 0.25 * vcl_sqrt( 3.0 ) * spacing[1];
this->m_DeltaTriangularPointB[0] = -0.5 * spacing[0];
this->m_DeltaTriangularPointB[1] = -0.25 * vcl_sqrt( 3.0 ) * spacing[1];
this->m_DeltaTriangularPointC[0] = 0.5 * spacing[0];
OK: So I checked in a change to BRAINSTools, which makes it pull the latest ANTs and ITKv4. I fixed the things mentioned in this issue for Visual Studio 2010, but the latest ANTs was incompatible with the ITKv4 version being pulled by BRAINSTools. So I also had to move to the latest ITKv4 version to get ANTs to compile.
Thank you for the quick fix. Could you also update the Teem library as well?
Can we reopen this issue? It still has not been resolved:
Tamas, this is not exactly the answer to your concerns, but you could try building BRAINS with ANTS disabled. It is not needed for our purposes. Also, you could look at the configuration options used for BRAINS by Slicer here https://github.com/Slicer/Slicer/blob/master/SuperBuild.cmake#L210-L248. We know that this configuration has no build issues on all three platforms: http://slicer.cdash.org/index.php?project=Slicer4 (correction: looks like the factory machines are using VS2008, not VS2010 that you reported, so not guaranteed the issues are the same). Hope this helps.
Unable to compile BRAINSTools HEAD with VS2010 Win64:
ANTs library does not compile:
in ExternalApplications\MALF\CorrectiveLearning\segAdapter.cxx from line 501 should be modified to
NeighborhoodIteratorType::OffsetType offset; offset[0] = j; offset[1] = k; offset[2] = l; X[C++] = autosegnit.GetPixel( offset ); for( size_t it = 0; it < ims.size(); it++ ) { X[C++] = imnits[it].GetPixel( offset ); }
in ExternalApplications\MALF\JointFusion\LabelFusion.cxx line 330 should be
int* tmap = new int[MaxV+1]; and line 342 delete[] tmap;
in ExternalApplications\MALF\JointFusion\WeightedVotingLabelFusionImageFilter.txx from line 319:
InputImagePixelType bestMatchSum = new InputImagePixelType[m_Modality]; InputImagePixelType bestMatchSSQ = new InputImagePixelType[m_Modality]; InputImagePixelType bestMatchMean = new InputImagePixelType[m_Modality]; InputImagePixelType bestMatchVar = new InputImagePixelType[m_Modality]; InputImagePixelType bestMatchSD = new InputImagePixelType[m_Modality]; InputImagePixelType MatchSum = new InputImagePixelType[m_Modality]; InputImagePixelType *MatchSSQ = new InputImagePixelType[m_Modality]; and from line 379: delete[] bestMatchSum; delete[] bestMatchSSQ; delete[] bestMatchMean; delete[] bestMatchVar; delete[] bestMatchSD; delete[] MatchSum; delete[] MatchSSQ;
With these modification I was able to compile dependent libraries, however I still have a few problems I cannot figure out in BRAINSTools BRAINSCommonLib project: