Dear Negar

You probably need more than 8 bit resolution to represent your data then. Try with  'dt' , [64 spm_platform('bigend’)] and if this works see how few you can get along with, 4 and 8 are other values which are accepted. (more about that in spm_type) 


Best
Torben

Den 13. jun. 2018 kl. 04.35 skrev negar noorizadeh <[log in to unmask]>:

Thanks for your response.
I removed it from structure like this:
            Vo_BM = struct('fname' , OutName_BM ,...
                'dim' , V_T2.dim , ...
                'dt' , [2 spm_platform('bigend')] , ...
                'mat' , V_T2.mat ,...
                'descrip', V_T2.descrip);
            Vo_write = spm_write_vol(Vo_BM , A);
but it still scales values in A for example maximum value becomes 0.996 instead of 1!!!!
I would be really appreciated if SPM experts have any solution for this problem.
Regards
Negar

On Tue, Jun 12, 2018 at 5:35 PM Jonathan Orawe <[log in to unmask]> wrote:
If you remove the pinfo field from the structure (using rmfield command), spm_write_vol will automatically write a new pinfo field from information automatically detected in your matrix.

Best, 
Jon

On Tue, Jun 12, 2018 at 5:44 PM, negar noorizadeh <[log in to unmask]> wrote:
Thanks for your quick response.
Unfortunately, my matrix has different values in range of 0 to 1 such as 0.001,0.55,0.896 and setting pinfo to [1;0;0] will force intensity to be only 0 and 1.I don't want to have only 0 and 1.
Is there any other solution to write my data with out any scaling by spm_write_vol?
Regards
Neagr


---------- Forwarded message ---------
From: Lalith Kumar Shiyam Sundar <[log in to unmask]>
Date: Tue, Jun 12, 2018 at 3:52 PM
Subject: Re: [SPM] Question about SPM_write_vol
To: negar noorizadeh <[log in to unmask]>


Hi, 
The pinfo should b = [1,0,0]
Cheers, 
Lalith 

Sent from my iPhone

On 12.06.2018, at 21:37, negar noorizadeh <[log in to unmask]> wrote:

Dear SPM Experts,
I have a question and I would be really appreciated if you can help.
I have a 3D matrix (for example A) that its values are in range of [0-1].
After writing A by spm_write_vol and read it again in Matlab I found that the intensity range was changed (maximum intensity is .9996 not 1).I think that pinfo has some effects in scaling data. Is there any way to write my data without any scaling to have the same intensity range as what I have in A?
Regards
Neagr



--
Jonathan O'Rawe
Graduate Student in Integrative Neuroscience
Dept. of Psychology
Stony Brook University
Stony Brook, NY 11794-2500
Office: Psychology B 339