⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 itkbiocelltest.cxx

📁 DTMK软件开发包,此为开源软件,是一款很好的医学图像开发资源.
💻 CXX
字号:
/*=========================================================================

  Program:   Insight Segmentation & Registration Toolkit
  Module:    $RCSfile: itkBioCellTest.cxx,v $
  Language:  C++
  Date:      $Date: 2004-10-04 17:43:02 $
  Version:   $Revision: 1.4 $

  Copyright (c) Insight Software Consortium. All rights reserved.
  See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.

     This software is distributed WITHOUT ANY WARRANTY; without even 
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
     PURPOSE.  See the above copyright notices for more information.

=========================================================================*/
#if defined(_MSC_VER)
#pragma warning ( disable : 4786 )
#endif

#include <iostream>

#include "itkBioCell.h"


int itkBioCellTest( int, char * [] )
{
   // Test for 2D 
   {
   std::cout << "Testing 2D " << std::endl;
   typedef itk::bio::Cell<2> CellType;
    
   CellType * egg = CellType::CreateEgg();

   CellType::VectorType forceVector;

   forceVector[0] = 10.5;
   forceVector[1] = 20.5;

   egg->ClearForce();
   egg->AddForce( forceVector );

   const double radius = egg->GetRadius();
   std::cout << "radius = " << radius << std::endl;

   CellType::SetGrowthRadiusLimit( 2.0 );
   CellType::SetGrowthRadiusIncrement( 0.1 );
   CellType::SetEnergySelfRepairLevel( 1.0 );
   CellType::SetNutrientSelfRepairLevel( 1.0 );

   CellType::SetGrowthMaximumLatencyTime( 10 );
   CellType::SetDivisionMaximumLatencyTime( 10 );

   std::cout << "Growth Latency = " << 
     CellType::GetGrowthMaximumLatencyTime() << std::endl;

   std::cout << "Division Latency = " << 
     CellType::GetDivisionMaximumLatencyTime() << std::endl;

   delete egg;

   }

   // Test for 3D 
   {
   std::cout << "Testing 3D " << std::endl;
   typedef itk::bio::Cell<3> CellType;
    
   CellType * egg = CellType::CreateEgg();

   CellType::VectorType forceVector;

   forceVector[0] = 10.5;
   forceVector[1] = 20.5;
   forceVector[2] = 30.5;

   egg->ClearForce();
   egg->AddForce( forceVector );

   const double radius = egg->GetRadius();
   std::cout << "radius = " << radius << std::endl;

   CellType::SetGrowthRadiusLimit( 2.0 );
   CellType::SetGrowthRadiusIncrement( 0.1 );
   CellType::SetEnergySelfRepairLevel( 1.0 );
   CellType::SetNutrientSelfRepairLevel( 1.0 );

   CellType::SetGrowthMaximumLatencyTime( 10 );
   CellType::SetDivisionMaximumLatencyTime( 10 );

   std::cout << "Growth Latency = " << 
     CellType::GetGrowthMaximumLatencyTime() << std::endl;

   std::cout << "Division Latency = " << 
     CellType::GetDivisionMaximumLatencyTime() << std::endl;

   delete egg;

   }


   // Test for 4D 
  {
   std::cout << "Testing 4D " << std::endl;
   typedef itk::bio::Cell<4> CellType;
    
   CellType * egg = CellType::CreateEgg();

   CellType::VectorType forceVector;

   forceVector[0] = 10.5;
   forceVector[1] = 20.5;
   forceVector[2] = 30.5;
   forceVector[3] = 15.5;

   egg->ClearForce();
   egg->AddForce( forceVector );

   const double radius = egg->GetRadius();
   std::cout << "radius = " << radius << std::endl;

   CellType::SetGrowthRadiusLimit( 2.0 );
   CellType::SetGrowthRadiusIncrement( 0.1 );
   CellType::SetEnergySelfRepairLevel( 1.0 );
   CellType::SetNutrientSelfRepairLevel( 1.0 );

   CellType::SetGrowthMaximumLatencyTime( 10 );
   CellType::SetDivisionMaximumLatencyTime( 10 );

   std::cout << "Growth Latency = " << 
     CellType::GetGrowthMaximumLatencyTime() << std::endl;

   std::cout << "Division Latency = " << 
     CellType::GetDivisionMaximumLatencyTime() << std::endl;

   delete egg;

   }

   std::cout << "Test Passed !" << std::endl;
   return EXIT_SUCCESS;
}











⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -