Main Content

niftiinfo

NIfTI 파일에서 메타데이터 읽어 들이기

설명

예제

info = niftiinfo(filename)filename으로 지정된 NIfTI(Neuroimaging Informatics Technology Initiative) 파일에서 메타데이터 info를 반환합니다. niftiinfo 함수는 NIfTI1NIfTI2 파일 형식을 모두 지원합니다.

예제

모두 축소

NIfTI 파일 brain.nii에서 메타데이터를 불러옵니다.

info = niftiinfo('brain.nii');

파일 버전을 표시합니다.

info.Version
ans = 
'NIfTI1'

파일의 픽셀 차원을 표시합니다.

info.PixelDimensions
ans = 1×3

     1     1     1

원시 헤더 내용을 표시합니다.

info.raw
ans = struct with fields:
        sizeof_hdr: 348
          dim_info: ' '
               dim: [3 256 256 21 1 1 1 1]
         intent_p1: 0
         intent_p2: 0
         intent_p3: 0
       intent_code: 0
          datatype: 2
            bitpix: 8
       slice_start: 0
            pixdim: [1 1 1 1 0 0 0 0]
        vox_offset: 352
         scl_slope: 0
         scl_inter: 0
         slice_end: 0
        slice_code: 0
        xyzt_units: 0
           cal_max: 0
           cal_min: 0
    slice_duration: 0
           toffset: 0
           descrip: ''
          aux_file: ''
        qform_code: 0
        sform_code: 0
         quatern_b: 0
         quatern_c: 0
         quatern_d: 0
         qoffset_x: 0
         qoffset_y: 0
         qoffset_z: 0
            srow_x: [0 0 0 0]
            srow_y: [0 0 0 0]
            srow_z: [0 0 0 0]
       intent_name: ''
             magic: 'n+1 '

원시 구조체에서 인텐트 코드를 표시합니다.

info.raw.intent_code
ans = 0

입력 인수

모두 축소

NIfTI 파일 이름으로, string형 스칼라 또는 문자형 벡터로 지정됩니다.

  • 파일 확장자를 지정하지 않으면 niftiinfo는 확장자가 .nii인 파일(또는 압축 파일인 경우 .nii.gz)을 찾습니다.

  • 확장자가 .nii 또는 .nii.gz인 파일을 찾을 수 없으면 niftiinfo는 파일 확장자가 .hdr인 파일(또는 압축 파일인 경우 .hdr.gz)을 찾습니다. 이중 파일 NIfTI 형식인 경우 .hdr 파일에는 볼륨과 연관된 메타데이터가 저장됩니다.

데이터형: char | string

출력 인수

모두 축소

NIfTI 볼륨과 연관된 메타데이터로, 구조체로 반환됩니다.

niftiinfo는 헤더의 메타데이터를 단순화된 형식으로 반환합니다. 그리고 더 쉽게 읽어 들일 수 있는 MATLAB® 구조체로 필드를 패키징하고 이름과 순서를 다시 지정합니다. 예를 들어 niftiinfo는 파일 메타데이터의 cal_maxcal_min 필드로부터 DisplayIntensityRange 필드를 만듭니다. 메타데이터를 파일에 표시되는 모습대로 보려면 반환되는 구조체의 raw 필드를 확인하십시오.

참고 문헌

[1] Cox, R. W., J. Ashburner, H. Breman, K. Fissell, C. Haselgrove, C. J. Holmes, J. L. Lancaster, D. E. Rex, S. M. Smith, J. B. Woodward, and S. C. Strother. "A (sort of) new image data format standard: NiFTI-1." 10th Annual Meeting of Organisation of Human Brain Mapping, Budapest, Hungary, June 2004.

버전 내역

R2017b에 개발됨

참고 항목

|