Xmipp  v3.23.11-Nereus
Public Member Functions | Public Attributes | List of all members
ExtractSubset::Settings Class Reference

#include <extract_subset.h>

Collaboration diagram for ExtractSubset::Settings:
Collaboration graph
[legend]

Public Member Functions

void check () const
 

Public Attributes

MetaDataVec md
 
FileName outXmd
 
FileName outStk
 
size_t first
 
size_t count
 
bool skipDisabled
 

Detailed Description

Definition at line 44 of file extract_subset.h.

Member Function Documentation

◆ check()

void ExtractSubset::Settings::check ( ) const

Definition at line 60 of file extract_subset.cpp.

60  {
61  // target directories must exist, so that we can write there
62  if ( ! outXmd.getDir().exists()) {
63  REPORT_ERROR(ERR_IO_NOTEXIST, "Directory " + outXmd.getDir() + " does not exist");
64  }
65  if ( ! outStk.getDir().exists()) {
66  REPORT_ERROR(ERR_IO_NOTEXIST, "Directory " + outStk.getDir() + " does not exist");
67  }
68  // target files must not exist, otherwise we will append to them
69  if (outXmd.exists()) {
70  REPORT_ERROR(ERR_IO_NOTEXIST, "File " + outXmd + " already exists.");
71  }
72  if (outStk.exists()) {
73  REPORT_ERROR(ERR_IO_NOTEXIST, "File " + outStk + " already exists");
74  }
75  const size_t n = md.size();
76  if (first >= n) {
77  REPORT_ERROR(ERR_LOGIC_ERROR, "Zero-based index of the first item ("
78  + std::to_string(first) + ") is bigger than size of the metadata ("
79  + std::to_string(n) + ")");
80  }
81  if (first + count > n) {
82  REPORT_ERROR(ERR_LOGIC_ERROR, "Out of range ("
83  + std::to_string(first) + " + "
84  + std::to_string(count) + " >= "
85  + std::to_string(n) + ")");
86  }
87 }
#define REPORT_ERROR(nerr, ErrormMsg)
Definition: xmipp_error.h:211
size_t size() const override
File or directory does not exist.
Definition: xmipp_error.h:136
bool exists() const
FileName getDir() const
std::string to_string(bond_type bondType)
Definition: compound.cpp:43
int * n
Some logical error in the pipeline.
Definition: xmipp_error.h:147

Member Data Documentation

◆ count

size_t ExtractSubset::Settings::count

Definition at line 50 of file extract_subset.h.

◆ first

size_t ExtractSubset::Settings::first

Definition at line 49 of file extract_subset.h.

◆ md

MetaDataVec ExtractSubset::Settings::md

Definition at line 46 of file extract_subset.h.

◆ outStk

FileName ExtractSubset::Settings::outStk

Definition at line 48 of file extract_subset.h.

◆ outXmd

FileName ExtractSubset::Settings::outXmd

Definition at line 47 of file extract_subset.h.

◆ skipDisabled

bool ExtractSubset::Settings::skipDisabled

Definition at line 51 of file extract_subset.h.


The documentation for this class was generated from the following files: