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

📄 ecatfile.m

📁 医学图像处理matlab工具箱
💻 M
📖 第 1 页 / 共 5 页
字号:
         'span',                            1, 'int16'
         'z_elements',                     64, 'int16'
         'fill1',                         123, 'int16'
         'fill2',                          50, 'int16' };
      
      hds.s = struct( 'fieldname', a(:,1), 'noelements', a(:,2), ...
         'type', a(:,3) );
      hds.header_size = 512;
      
      % polar map
   case 5
      a = { ...
            'data_type',                       1, 'int16'
         'polar_map_type',                  1, 'int16'
         'num_rings',                       1, 'int16'
         'sectors_per_ring',               32, 'int16'
         'ring_position',                  32, 'float32'
         'ring_angle',                     32, 'int16'
         'start_angle',                     1, 'int16'
         'long_axis_left',                  3, 'int16'
         'long_axis_right',                 3, 'int16'
         'position_data',                   1, 'int16'
         'image_min',                       1, 'int16'
         'image_max',                       1, 'int16'
         'scale_factor',                    1, 'float32'
         'pixel_size',                      1, 'float32'
         'frame_duration',                  1, 'int32'
         'frame_start_time',                1, 'int32'
         'processing_code',                 1, 'int16'
         'quant_units',                     1, 'int16'
         'annotation',                     40, 'char'
         'gate_duration',                   1, 'int32'
         'r_wave_offset',                   1, 'int32'
         'num_accepted_beats',              1, 'int32'
         'polar_map_protocol',             20, 'char'
         'database_name',                  30, 'char'
         'fill1',                          27, 'int16'
         'fill2',                          27, 'int16' };
      
      hds.s = struct( 'fieldname', a(:,1), 'noelements', a(:,2), ...
         'type', a(:,3) );
      hds.header_size = 512;
      
   case 7
      % image
      a = { ...
            'data_type',                       1, 'int16'
         'num_dimensions',                  1, 'int16'
         'xyz_dimension',                   3, 'int16'
         'xyz_offset',                      3, 'float32'
         'recon_zoom',                      1, 'float32'
         'scale_factor',                    1, 'float32'
         'image_min',                       1, 'int16'
         'image_max',                       1, 'int16'
         'xyz_pixel_size',                  3, 'float32'
         'frame_duration',                  1, 'int32'
         'frame_start_time',                1, 'int32'
         'filter_code',                     1, 'int16'
         'xyz_resolution',                  3, 'float32'
         'num_r_elements',                  1, 'float32'
         'num_angles',                      1, 'float32'
         'z_rotation_angle',                1, 'float32'
         'decay_corr_fctr',                 1, 'float32'
         'processing_code',                 1, 'int32'
         'gate_duration',                   1, 'int32'
         'r_wave_offset',                   1, 'int32'
         'num_accepted_beats',              1, 'int32'
         'filter_cutoff_frequency',         1, 'float32'
         'filter_resolution',               1, 'float32'
         'filter_ramp_slope',               1, 'float32'
         'filter_order',                    1, 'int16'
         'filter_scatter_fraction',         1, 'float32'
         'filter_scatter_slope',            1, 'float32'
         'annotation',                     40, 'char'
         'mt',                              9, 'mat1st'
         'rfilter_cutoff',                  1, 'float32'
         'rfilter_resolution',              1, 'float32'
         'rfilter_code',                    1, 'int16'
         'rfilter_order',                   1, 'int16'
         'zfilter_cutoff',                  1, 'float32'
         'zfilter_resolution',              1, 'float32'
         'zfilter_code',                    1, 'int16'
         'zfilter_order',                   1, 'int16'
         'mt',                              3, 'mat2nd'
         'scatter_type',                    1, 'int16'
         'recon_type',                      1, 'int16'
         'recon_views',                     1, 'int16'
         'fill',                          136, 'int16' };
      
      hds.s = struct( 'fieldname', a(:,1), 'noelements', a(:,2), ...
         'type', a(:,3) );
      hds.header_size = 512;
      
   case { 11, 14 }
      % 3D sinogram
      a = { ...
            'data_type',                       1, 'int16'
         'num_dimensions',                  1, 'int16'
         'num_r_elements',                  1, 'int16'
         'num_angles',                      1, 'int16'
         'corrections_applied',             1, 'int16'
         'num_z_elements',                 64, 'int16'
         'ring_difference',                 1, 'int16'
         'storage_order',                   1, 'int16'
         'axial_compression',               1, 'int16'
         'x_resolution',                    1, 'float32'
         'v_resolution',                    1, 'float32'
         'z_resolution',                    1, 'float32'
         'w_resolution',                    1, 'float32'
         'fill1',                           6, 'int16'
         'gate_duration',                   1, 'int32'
         'r_wave_offset',                   1, 'int32'
         'num_accepted_beats',              1, 'int32'
         'scale_factor',                    1, 'float32'
         'scan_min',                        1, 'int16'
         'scan_max',                        1, 'int16'
         'prompts',                         1, 'int32'
         'delayed',                         1, 'int32'
         'multiples',                       1, 'int32'
         'net_trues',                       1, 'int32'
         'tot_avg_cor',                     1, 'float32'
         'tot_avg_uncor',                   1, 'float32'
         'total_coin_rate',                 1, 'int32'
         'frame_start_time',                1, 'int32'
         'frame_duration',                  1, 'int32'
         'deadtime_correction_factor',      1, 'float32'
         'fill2',                          90, 'int16'
         'fill3',                          50, 'int16'
         'uncor_singles',                 128, 'float32' };
      
      hds.s = struct( 'fieldname', a(:,1), 'noelements', a(:,2), ...
         'type', a(:,3) );
      hds.header_size = 1024;
      
   case 13
      % 3D normalization
      a = { ...
            'data_type',                       1, 'int16'
         'num_r_elements',                  1, 'int16'
         'num_transaxial_crystals',         1, 'int16'
         'num_crystal_rings',               1, 'int16'
         'crystals_per_ring',               1, 'int16'
         'num_geo_corr_planes',             1, 'int16'
         'uld',                             1, 'int16'
         'lld',                             1, 'int16'
         'scatter_energy',                  1, 'int16'
         'norm_quality_factor',             1, 'float32'
         'norm_quality_factor_code',        1, 'int16'
         'ring_dtcor1',                    32, 'float32'
         'ring_dtcor2',                    32, 'float32'
         'crystal_dtcor',                   8, 'float32'
         'span',                            1, 'int16'
         'max_ring_diff',                   1, 'int16'
         'fill1',                          48, 'int16'
         'fill2',                          50, 'int16' };
      
      hds.s = struct( 'fieldname', a(:,1), 'noelements', a(:,2), ...
         'type', a(:,3) );
      hds.header_size = 512;
   otherwise
      message = 'Illegal file type';
      
   end % switch file_type
   
   hds.file_system = 'ecat7sh';
   
case 'ecat6.4'
   
   switch file_type
      % implemented:
      % 01=.scn, 02=.img, 03=.atn, 04=.nrm 
      
   case 1 % .scn
      
      a = { ...
            'fill1',                          63, 'int16'
         'data_type',                       1, 'int16'
         'fill2',                           2, 'int16'
         'dimension_1',                     1, 'int16'
         'dimension_2',                     1, 'int16'
         'smoothing',                       1, 'int16'
         'processing_code',                 1, 'int16'
         'fill3',                           3, 'int16'
         'sample_distance',                 1, 'float32'
         'fill4',                           8, 'int16'
         'isotope_halflife',                1, 'float32'
         'frame_duration_sec',              1, 'int16'
         'gate_duration',                   1, 'int32'
         'r_wave_offset',                   1, 'int32'
         'fill5',                           1, 'int16'
         'scale_factor',                    1, 'float32'
         'fill6',                           3, 'int16'
         'scan_min',                        1, 'int16'
         'scan_max',                        1, 'int16'
         'prompts',                         1, 'int32'
         'delayed',                         1, 'int32'
         'multiples',                       1, 'int32'
         'net_trues',                       1, 'int32'
         'fill7',                          52, 'int16'
         'cor_singles',                    16, 'float32'
         'uncor_singles',                  16, 'float32'
         'tot_avg_cor',                     1, 'float32'
         'tot_avg_uncor',                   1, 'float32'
         'total_coin_rate',                 1, 'int32'
         'frame_start_time',                1, 'int32'
         'frame_duration',                  1, 'int32'
         'loss_correction_fctr'             1, 'float32'
         'fill8',                          22, 'int16' };
      
      hds.s = struct( 'fieldname', a(:,1), 'noelements', a(:,2), ...
         'type', a(:,3) );
      hds.header_size = 512;
      
   case 2 % .img
      
      a = { ...
            'fill1',                          63, 'int16'
         'data_type',                       1, 'int16'
         'num_dimensions',                  1, 'int16'
         'fill2',                           1, 'int16'
         'dimension_1',                     1, 'int16'
         'dimension_2',                     1, 'int16'
         'fill3',                          12, 'int16'
         'x_origin',                        1, 'float32'
         'y_origin',                        1, 'float32'
         'recon_scale',                     1, 'float32'
         'quant_scale',                     1, 'float32'
         'image_min',                       1, 'int16'
         'image_max',                       1, 'int16'
         'fill4',                           2, 'int16'
         'pixel_size',                      1, 'float32'
         'slice_width',                     1, 'float32'
         'frame_duration',                  1, 'int32'
         'frame_start_time',                1, 'int32'
         'slice_location',                  1, 'int16'
         'recon_start_hour',                1, 'int16'
         'recon_start_min',                 1, 'int16'
         'recon_start_sec',                 1, 'int16'
         'recon_duration',                  1, 'int32'
         'fill5',                          12, 'int16'
         'filter_code',                     1, 'int16'
         'scan_matrix_num',                 1, 'int32'
         'norm_matrix_num',                 1, 'int32'
         'atten_cor_mat_num',               1, 'int32'
         'fill6',                          23, 'int16'
         'image_rotation',                  1, 'float32'
         'plane_eff_corr_fctr',             1, 'float32'
         'decay_corr_fctr',                 1, 'float32'
         'loss_corr_fctr',                  1, 'float32'
         'fill7',                          32, 'int16'
         'processing_code',                 1, 'int16'
         'fill8',                           1, 'int16'
         'quant_units',                     1, 'int16'
         'recon_start_day',                 1, 'int16'
         'recon_start_month',               1, 'int16'
         'recon_start_year',                1, 'int16'
         'ecat_calibration_fctr',           1, 'float32'
         'well_counter_cal_fctr',           1, 'float32'
         'filter_params',                   6, 'float32'
         'annotation',                     40, 'char'
         'fill9',                          26, 'int16' };
         
         hds.s = struct( 'fieldname', a(:,1), 'noelements', a(:,2), ...
            'type', a(:,3) );
         hds.header_size = 512;
      
   case 3 % .atn
      
      a = { ...
            'fill1',                          63, 'int16'
         'data_type',                       1, 'int16'
         'attenuation_type',                1, 'int16'
         'fill2',                           1, 'int16'
         'dimension_1',                     1, 'int16'
         'dimension_2',                     1, 'int16'
         'fill3',                          23, 'int16'
         'scale_factor',                    1, 'float32'
         'x_origin',                        1, 'float32'
         'y_origin',                        1, 'float32'
         'x_radius',                        1, 'float32'
         'y_radius',                        1, 'float32'
         'tilt_angle',                      1, 'float32'
         'attenuation_coeff',               1, 'float32'
         'sample_distance',                 1, 'float32'
         'fill4',                         149, 'int16' };
         
         hds.s = struct( 'fieldname', a(:,1), 'noelements', a(:,2), ...
            'type', a(:,3) );
         hds.header_size = 512;
      
   case 4 % .nrm
      
      a = { ...
            'fill1',                          63, 'int16'
         'data_type',                       1, 'int16'
         'fill2',                           2, 'int16'
         'dimension_1',                     1, 'int16'
         'dimension_2',                     1, 'int16'
         'fill3',                          23, 'int16'
         'scale_factor',                    1, 'float32'
         'norm_hour',                       1, 'int16'
         'norm_minute',                     1, 'int16'
         'norm_second',                     1, 'int16'
         'norm_day',                        1, 'int16'
         'norm_month',                      1, 'int16'
         'norm_year',                       1, 'int16'
         'fov_source_width',                1, 'float32'
         'fill4',                         155, 'int16' };
      
      hds.s = struct( 'fieldname', a(:,1), 'noelements', a(:,2), ...
         'type', a(:,3) );
      hds.header_size = 512;
   otherwise
      message = 'Illegal file type';
      
   end % switch file_type
   
   hds.file_system = 'ecat6.4sh';
   
otherwise
   message = 'Illegal file system';
   
end % switch file_system

function [ datadescr, message ] = getdatadescr( file_system, file_type, data_type );

datadescr = [];
message = '';

switch file_system
   
case 'ecat6.4'
   switch file_type
      
   case { 1, 2, 3, 4 }
      % 1 = .scn, 2 = .img, 3 = .atn, 4 = .nrm
      switch data_type
      case 2 % VAX_Ix2
         datadescr.ftype = 'int16';
         datadescr.size = 2;
      case 4 % vax float
         datadescr.ftype = 'float32';
         datadescr.size = 4;
      case 5 % ieee float
         datadescr.ftype = 'float32';
         datadescr.size = 4;
      otherwise
         message = 'Data type not im

⌨️ 快捷键说明

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