binary data reading into an image

조회 수: 5 (최근 30일)
Evolution
Evolution 2012년 11월 11일
I need some help with a bin file i have downloaded.it contains slices of the brain mri. this is the info i got about the .bin file
The suffix “bin” indicates that the file is a stream of binary numbers. The numbers are encoded as two-byte two's complement integers. The byte order is big-endian. This order is the standard for Sun workstations. Odd and even bytes must be interchanged for DEC VAX computers and Intel 80x86 microprocessors. The “.bin” file contains the voxels in row-column-slice order, meaning that the first voxel in the file should be displayed in the upper left of the screen, the second voxel should be displayed to the right of the first, etc., until the end of the row is reached. The next voxel should be displayed below the first voxel of the file, the next to the right of that, etc., until one complete slice is displayed. The first voxel of the second slice follows the last voxel of the first slice, etc.
thank you

채택된 답변

Walter Roberson
Walter Roberson 2012년 11월 11일
fread() with '*int16' as the precision. reshape() the linear stream into a cuboid and then permute() [2 1 3] to change the data order to MATLAB's data order.
  댓글 수: 5
Walter Roberson
Walter Roberson 2012년 11월 12일
Instead of converting it to uint8(), try using imagesc() on the int16 data.
Evolution
Evolution 2012년 11월 12일
thanks it worked absolutely fine .

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Import, Export, and Conversion에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by