Changeset 601


Ignore:
Timestamp:
08/28/16 15:19:57 (8 years ago)
Author:
oriona
Message:

Possibility of fixing z axis during the alignment added.

Location:
cpp/frams
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/_demos/simil_test.cpp

    r459 r601  
    4747    int nResult = 0; // a temporary result
    4848
    49     if (argc < 6)
     49    if (argc < 7)
    5050    {
    5151        // too few parameters
    5252        printf("Too few parameters!\n");
    53         printf("Command line: [-names] <genotypesFile> <w_dP> <w_dDEG> <w_dNEU> <w_dGEO> \n\n");
     53        printf("Command line: [-names] <genotypesFile> <w_dP> <w_dDEG> <w_dNEU> <w_dGEO> <isZfixed>\n\n");
    5454        printf("Parameters:\n");
    5555        printf(" <genotypesFile> name of a file with genotypes\n");
     
    5858        printf(" <w_dNEU> weight of the difference in neurons of matched parts\n");
    5959        printf(" <w_dGEO> weight of the distance of matched parts\n\n");
     60        printf(" <isZFixed> should z cooridante be fixed during the alignment\n");
    6061        printf("Switches:\n");
    6162        printf(" -names specifies that the number and names of genotypes are to be printed to output\n");
     
    120121    }
    121122
     123    iCurrParam++;
     124    szCurrParam = argv[ iCurrParam ];
     125    nResult = sscanf(szCurrParam, " %d", & M.zFixed);
     126    if (nResult != 1)
     127    {
     128        // <isZFixed> is not a number -- error
     129        printf("<isZFixed> should be a number\n");
     130        return -1;
     131    }
     132    else if (M.zFixed != 0 && M.zFixed !=1)
     133    {
     134        printf("<isZFixed>=%d. <isZFixed> should be equal to 0 or 1\n", M.zFixed);
     135        return -1;
     136    }
     137   
    122138    // read the input file
    123139    // prepare loading of genotypes from a .gen file
  • cpp/frams/model/similarity/simil_model.cpp

    r492 r601  
    19971997            // get the position of the Part
    19981998            P1Pos = P1->p;
     1999            if (zFixed == 1)
     2000            {
     2001                P1Pos.z = 0;   
     2002            }
    19992003            for (iP2 = 0; iP2 < pModel->getPartCount(); iP2++)
    20002004            {
     
    20032007                // get the position of the Part
    20042008                P2Pos = P2->p;
     2009                if (zFixed == 1)
     2010                {
     2011                        P2Pos.z = 0;   
     2012                }
    20052013                // compute the geometric (Euclidean) distance between the Parts
    20062014                dDistance = P1Pos.distanceTo(P2Pos);
     
    20112019
    20122020        MatrixTools::SVD(vEigenvalues, nSize, pDistances, m_aPositions[ iMod ]);
     2021        if (zFixed == 1)
     2022        {
     2023                for (int coord = 0; coord < pModel->getPartCount(); coord++)
     2024                {
     2025                        m_aPositions[ iMod ][coord].z = pModel->getPart(coord)->p.z;
     2026                }
     2027        }
     2028       
    20132029        free(pDistances);
    20142030    }
  • cpp/frams/model/similarity/simil_model.h

    r357 r601  
    8585    int fuzzyDepth;
    8686    int isFuzzy;
     87    //for Zfixed = 1 z coordinates are not taken into account during PCA alignment
     88    int zFixed;
    8789
    8890    /// Interface to local parameters
Note: See TracChangeset for help on using the changeset viewer.