Skip to content

Neuroimaging Informatics Technology Initiative

Sections
Personal tools
You are here: Home
phorum - NIfTI Message Board - Re: How to convert Nifti image to raw image
NIfTI Message Board

 New Topic  |  Go to Top  |  Go to Topic  |  Search   Previous Message  |  Next Message 
 Re: How to convert Nifti image to raw image
Author: Cinly Ooi (---.psychiatry.cam.ac.uk)
Date:   05-02-08 09:54

My post was never intended to provide better contrast but simply to make sure that you capture the full-range of data correctly. As you had indicated, you read above the 8th bit. With standard C conversion from short->uchar, you will *lose* bit 9 onwards thus corrupting your data. My suggestion is a workaround trying to prevent the lost of data. It is designed to capture the full data range of your short data by scaling the 256 available data value in uchar to fit your data range.

In fact, I just realize that you should store two additional values, i.e. scl_slope and scl_inter on to your header if, as your other posting indicate, you might be interested in the header information as well. This is performed by reformulating the scaling arrangement as y=mx+c where x is your uchar data and y the original short data, then put m as scl_slope and c as scl_inter. In this way, you can recover your actual value if need be later.

IMHO, do not worry about your image having bad contrast when viewed. If you must, you can always manipulate the contrast setting/grey level setting of your viewing program to compensate. What is most important is your data is correct and accurate and is what you wanted.

HTH

 Reply To This Message  |  Flat View   Newer Topic  |  Older Topic 

 Topics Author  Date
 How to convert Nifti image to raw image  new
said khalid shah 04-17-08 08:55 
 Re: How to convert Nifti image to raw image  
bob cox 05-01-08 11:09 
 Re: How to convert Nifti image to raw image  
said khalid shah 05-01-08 11:13 
 Re: How to convert Nifti image to raw image  new
rick reynolds 05-01-08 11:27 
 Re: How to convert Nifti image to raw image  new
khalid 05-01-08 13:05 
 Re: How to convert Nifti image to raw image  new
Cinly Ooi 05-02-08 09:46 
 Re: How to convert Nifti image to raw image  new
Cinly Ooi 05-01-08 12:41 
 Re: How to convert Nifti image to raw image  
Khalid 05-01-08 13:57 
 Re: How to convert Nifti image to raw image  
Cinly Ooi 05-02-08 09:54 


 New Topic  |  Go to Top  |  Go to Topic  |  Search 
 Reply To This Message
 Your Name:
 Your E-mail:
 Subject:
   
 

Powered by Plone

phorum.org

This site conforms to the following standards: