Skip to content

Commit

Permalink
Bug fix for segmentation fault and remove flat images (#26)
Browse files Browse the repository at this point in the history
* AreTomo2 1.1.0: Reduced dependency of library files. Provided the source of remaining library files in LibSrc. Improved CTF estimation

* AreTomo2 1.1.1 revised the generation of Imod files.

* AreTomo2 1.1.2: add user manual and bug fix.

* AreTomo2 1.1.3, bug fix and removing flat tilt images in tilt series.

---------

Co-authored-by: Shawn Zheng <[email protected]>
  • Loading branch information
szhengczii and Shawn Zheng authored Aug 19, 2024
1 parent e9f8941 commit 01e7219
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 4 deletions.
4 changes: 2 additions & 2 deletions CAreTomoMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ int main(int argc, char* argv[])
if(argc == 2)
{ if(strcasecmp(argv[1], "--version") == 0 ||
strcasecmp(argv[1], "-v") == 0)
{ printf("AreTomo2 version 1.1.2\n"
"Built on Feb 20 2024\n");
{ printf("AreTomo2 version 1.1.3\n"
"Built on Aug 19 2024\n");
}
else if(strcasecmp(argv[1], "--help") == 0)
{ printf("\nUsage: AreTomo2 Tags\n");
Expand Down
1 change: 1 addition & 0 deletions CProcessThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ void CProcessThread::mRotAlign(void)

void CProcessThread::mFindTiltOffset(void)
{
m_fTiltOffset = 0.0f;
CInput* pInput = CInput::GetInstance();
if(pInput->m_afTiltCor[0] < 0) return;
//-----------------
Expand Down
8 changes: 6 additions & 2 deletions MrcUtil/CRemoveDarkFrames.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,12 @@ void CRemoveDarkFrames::DoIt
pDarkFrames->Setup(s_pTomoStack);
//-----------------
for(int i=0; i<iAllFrms; i++)
{ float fRatio = (float)fabs(pfMeans[i]) /
(pfStds[i] + 0.000001f);
{ if(pfStds[i] <= 1e-10)
{ pDarkFrames->AddDark(i);
continue;
}
//----------------
float fRatio = (float)fabs(pfMeans[i]) / pfStds[i];
if(fRatio > fTol) continue;
//----------------
pDarkFrames->AddDark(i);
Expand Down
11 changes: 11 additions & 0 deletions ProjAlign/CCalcReproj.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,17 @@ void CCalcReproj::mFindProjRange(float* pfTiltAngles, bool* pbSkipProjs)
iEnd = i;
}
//---------------------------------------------
// 1) Prevent an unusual situation where the
// angular step is so large causing stretching
// factor larger that allowed. 2) In that case
// we just use the nearest lower tilt image.
//---------------------------------------------
if(iStart < 0 || iEnd < 0)
{ int iSign = (fProjA > 0) ? 1 : -1;
iStart = m_iProjIdx - iSign;
iEnd = iStart;
}
//-----------------
if((iEnd - iStart) > 9) iEnd = iStart + 9;
m_aiProjRange[0] = iStart;
m_aiProjRange[1] = iEnd;
Expand Down
15 changes: 15 additions & 0 deletions Readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -375,3 +375,18 @@ AreTomo2 1.1.2 [02-20-2024]
and then subtract the min and add 1. The line number is then iAcqIdx - 1.
2. DoseWeight/CWeightTomoStack: Check if iAcqIdx is 0-based. If so, add
1 to it.

AreTomo2 1.1.3 [06-17-2024]
---------------------------
1. Bug fix: random tilt angle values saved in .aln file.
1) m_fTiltOffset in CProcessThread.cpp was not inititialized. Some
system initializes it with a random large numbers. When -TiltCor -1
is used, tilt offset is not estimated and m_fTiltOffset stores the
random value, rather than zero that is added to the tilt angles.
Fix: added m_fTiltOffset = 0 in mFindTiltOffset. [06-17-2024]
2. Bug fix: AreTomo2 crashed when tilt angle file only has one column.
1) To be done.
3. Bug fix: ProjAlign/CCalcReproj::mFindProjRange: needs to check whether
m_aiProjRange constains -1. Fixed on 08-19-2024.
4. Added in MrcUtil/CRemoveDarkFrames.cpp a check for flat images that have
very small sigma. They are rejected.

0 comments on commit 01e7219

Please sign in to comment.