Xmipp  v3.23.11-Nereus
Classes | Functions
IDR Xray Tomography
Collaboration diagram for IDR Xray Tomography:

Classes

class  ProgIDRXrayTomo
 

Functions

int reconsTomo3D (const MetaData &MD, const FileName &fnOut, const String &params="")
 
int reconsTomo3D (const FileName &fnAngles, const FileName &fnProjs, const FileName &fnOut, const String &params="")
 

Detailed Description

Function Documentation

◆ reconsTomo3D() [1/2]

int reconsTomo3D ( const MetaData MD,
const FileName fnOut,
const String params = "" 
)

Reconstruct tomogram projections using external tomo3D

Parameters
MDIncludes tilt angle values and projections file names
fnOutReconstructed output volume name
paramsOther parameters to be passed to tomo3D
Returns
True if external system call ran right. Otherwise False

Definition at line 311 of file idr_xray_tomo.cpp.

312 {
313  // Saving angles in plain text to pass to tomo3D
314  FileName fnAngles("idr_xray_tomo_to_tomo3d_angles.txt");
315  std::vector<MDLabel> desiredLabels;
316  desiredLabels.push_back(MDL_ANGLE_TILT);
317  MD.writeText(fnAngles, &desiredLabels);
318 
319  FileName fnProjs;
320 
321  MD.getValue(MDL_IMAGE, fnProjs, MD.firstRowId());
322 
323  // Projections must be in an MRC stack to be passed
324  if ( !(fnProjs.isInStack() && (fnProjs.contains("mrc") || fnProjs.contains("st"))))
325  {
326  //FIXME: To be implemented the conversion to an MRC stack
327 
328  REPORT_ERROR(ERR_IMG_NOREAD, "reconsTromo3D: Image format cannot be read by tomo3D.");
329  }
330 
331  return reconsTomo3D(fnAngles, fnProjs.removePrefixNumber(), fnOut, params);
332 }
#define REPORT_ERROR(nerr, ErrormMsg)
Definition: xmipp_error.h:211
Tilting angle of an image (double,degrees)
virtual size_t firstRowId() const =0
FileName removePrefixNumber() const
Cannot read image from file.
Definition: xmipp_error.h:128
virtual bool getValue(MDObject &mdValueOut, size_t id) const =0
virtual void writeText(const FileName fn, const std::vector< MDLabel > *desiredLabels) const =0
FileName fnOut
int reconsTomo3D(const MetaData &MD, const FileName &fnOut, const String &params)
bool contains(const String &str) const
Name of an image (std::string)
bool isInStack() const

◆ reconsTomo3D() [2/2]

int reconsTomo3D ( const FileName fnAngles,
const FileName fnProjs,
const FileName fnOut,
const String params = "" 
)

Reconstruct tomogram projections using external tomo3D

Parameters
fnAnglesText file with angles sequence
fnProjsMRC stack file with projections
fnOutReconstructed output volume name
paramsOther parameters to be passed to tomo3D
Returns
True if external system call ran right. Otherwise False

Definition at line 334 of file idr_xray_tomo.cpp.

336 {
337  String exec("tomo3d -n -f -v 0 -a "+fnAngles+" -i "+fnProjs.removeAllPrefixes()+" -o "+fnOut+" "+params);
338  return system(exec.c_str());
339 }
FileName removeAllPrefixes() const
std::string String
Definition: xmipp_strings.h:34