QStringList flat() const

Calls flat on every File in the list and returns the resulting strings as a QStringList.

  • function definition:

    QStringList flat() const
    
  • parameters: NONE

  • output: (QStringList) Returns a list of the output of calling flat on each File
  • example:
    File f1("picture1.jpg"), f2("picture2.jpg");
    f1.set("Key", QString("Value"));
    
    FileList fList(QList<File>() << f1 << f2);
    fList.flat(); // returns ["picture1.jpg[Key=Value]", "picture2.jpg"]
    

QStringList names() const

Get the names of every File in the list.

  • function definition:

    QStringList names() const
    
  • parameters: NONE

  • output: (QStringList) Returns the name of every File in the list
  • example:
    File f1("picture1.jpg"), f2("picture2.jpg");
    f1.set("Key", QString("Value"));
    
    FileList fList(QList<File>() << f1 << f2);
    fList.names(); // returns ["picture1.jpg", "picture2.jpg"]
    

void sort(const QString &key)

Sort the FileList based on the values associated with a provided key in each File.

  • function definition:

    void sort(const QString &key)
    
  • parameters:

    Parameter Type Description
    key const QString & Key to look up desired values in each Files metadata
  • output: (void)

  • example:
    File f1("1"), f2("2"), f3("3");
    f1.set("Key", QVariant::fromValue<float>(3));
    f2.set("Key", QVariant::fromValue<float>(1));
    f3.set("Key", QVariant::fromValue<float>(2));
    
    FileList fList(QList<File>() << f1 << f2 << f3);
    fList.names(); // returns ["1", "2", "3"]
    
    fList.sort("Key");
    fList.names(); // returns ["2", "3", "1"]
    

QList<int> crossValidationPartitions() const

Get the cross-validation partion of each File in the list. The partition is stored in each File at metadata["Partition"].

  • function definition:

    QList<int> crossValidationPartitions() const
    
  • parameters: NONE

  • output: (QList<int>) Returns the cross-validation partion of each File as a list. If a File does not have the "Partition" field in it's metadata 0 is used.
  • example:
    File f1, f2, f3;
    f1.set("Partition", QVariant::fromValue<int>(1));
    f3.set("Partition", QVariant::fromValue<int>(3));
    
    FileList fList(QList<File>() << f1 << f2 << f3);
    fList.crossValidationPartitions(); // returns [1, 0, 3]
    

int failures() const

Get the number of Files in the list that have failed to enroll.

  • function definition:

    int failures() const
    
  • parameters: NONE

  • output: (int) Returns the number of Files that have fte equal true.
  • example:
    File f1, f2, f3;
    f1.fte = false;
    f2.fte = true;
    f3.fte = true;
    
    FileList fList(QList<File>() << f1 << f2 << f3);
    fList.failures(); // returns 2