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

📄 ctrecon.c

📁 本源码经过上机调试,是CT算法在TI的CCS下编程 可以在DSP硬件和软件仿真条件下运行,同时对CT算法在ARM,MIPS,PC,FPGA等上实现都有借鉴意义.搞CT等重建算法的人值得一看
💻 C
字号:
/*
 *  Copyright 2006 by OCT lab.
 *  Author: Lihui.
 *  Date: 2006.12.13 
 *  Version: 1.0  
 */
/* "@(#) DSP/BIOS 4.90.270 06-11-03 (barracuda-m10)" */
/***************************************************************************/
/*                                                                         */
/*     C T R E C O N . C                                                   */
/*                                                                         */
/*     CT reconstruction algorithm testing                                 */
/*                                                                         */
/***************************************************************************/

#include <stdio.h>
#include "ctrecon.h"
#include "CTlib.h"
#include <time.h>
//#include "stdio.h"
#include <stdlib.h> 

/* Global declarations */

float proj_buffer[NP_MAX*RPV_MAX];//projection data buffers
float w_buffer[NP_MAX*RPV_MAX*RECONMN_MAX*RECONMN_MAX];//projection matrix data buffers
float recon_buffer[RECONMN_MAX*RECONMN_MAX];//recontruction data buffers


/* Functions */


/*
 * ======== main ========
 */
void main()
{
     unsigned int start,stop, overhead,cycles;  
    float *pW=&w_buffer[0];//pointer to projection matrix
    float *pP=&proj_buffer[0];
    float *pF=&recon_buffer[0];
   
//diff=stop-start-overhead;

    int K=4;//CT reconstructiong parameters
    int S=5;
    int M=5;
    int N=5;
        
    int i;//loop variable
    //int *pint=(int*)malloc(sizeof(int)*10);
    //free(pint);
    
    for(i=0;i<K*S;i++)
    {
    pP[i]=1.0;
    }
    
    for(i=0;i<M*N;i++)
    {
    pF[i]=1.0;
    }
    
     
   start = clock(); /* Calculate overhead of calling clock*/

       stop = clock(); /* and subtract this value from The results*/

       overhead = stop - start;

start = clock();
    CTw(pW,K,S,M,N);
   CTsirt(pP,pW,pF,K,S,M,N,50,0.6);
stop = clock();

       cycles = stop - start - overhead; 
        printf( "15X15 SIRT TIME USED: \n " );
        printf( "cycles of overhead: %d  \n " , overhead);   
        printf( "cycles of start: %u  \n " , start);
        printf( "cycles of stop: %u  \n " , stop);
        printf( "used cycles of SIRT : %d  \n " , cycles);
        printf("used time of SIRT: %.2f  ms with DSP 600MHz\n",((float) cycles /(float)600000)); 

    
   
    //puts("testing over!\n");

    
    
}

⌨️ 快捷键说明

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