Skip to content

Neuroimaging Informatics Technology Initiative

Sections
Personal tools
You are here: Home
phorum - NIfTI Message Board - Re: NIfTI extension case
NIfTI Message Board

 New Topic  |  Go to Top  |  Go to Topic  |  Search   Previous Message  |  Next Message 
 Re: NIfTI extension case
Author: Cinly OOI (---.medschl.cam.ac.uk)
Date:   04-28-09 10:25

Dear Rick

my $0.02:

Can I suggest encapsulating the system into a function, say switchFilename(filename, level). All other functions that you mention will call this function to perform the necessary conversions.

For example

In quasi pseudocode:
#define FILENAME_VARIATION_END 100

/**
* switch the filename, according to the 'level'
* \param myfilename On input, the filename
* must be large enough to
* accommodate the variation requirested.
* Recommend length(filename) +7 to satisfy
* all possible variation. On output, will
* contain the filename that staistfy the level
* \param level the variation required
* [0, FILENAME_VARIATION_END)
* \return myfilename
*/
char* switchFilename(char *myfilename, int level) {
if(level==0) return myfilename;
/* don't want any modification */

/* strip all extesions */
stripExtension(myfilename);
if(level==1) return myfilename.NII
if(level==2) return myfilename.HDR
if(level==3) return myfilename.IMG
....
}
FILE* fp = open(myfilename);
myfile.NII will find any of myfile.NII, myfile.HDR,
myfile.IMG or .GZ versions, in that order.



The idea is (1) future modification will be centralized in one place, (2) other people can change the definition of this function to customize the library to cope with different file systems in the future, (3) [important to me] Using (2) I can choose to disable the system.



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

 Topics Author  Date
 NIfTI extension case  new
Mathieu Coursolle 04-21-09 09:54 
 Re: NIfTI extension case  new
rick reynolds 04-21-09 16:15 
 Re: NIfTI extension case  new
Cinly OOI 04-22-09 09:47 
 Re: NIfTI extension case  new
rick reynolds 04-22-09 18:00 
 Re: NIfTI extension case  new
Cinly OOI 04-23-09 08:49 
 Re: NIfTI extension case  new
Cinly OOI 04-24-09 06:37 
 Re: NIfTI extension case  new
rick reynolds 04-27-09 19:03 
 Re: NIfTI extension case  
Cinly OOI 04-28-09 10:25 
 Re: NIfTI extension case  new
Cinly OOI 04-28-09 10:27 
 Re: NIfTI extension case  
rick reynolds 04-28-09 12:48 
 Re: NIfTI extension case  new
Cinly OOI 04-28-09 13:41 
 Re: NIfTI extension case  
rick reynolds 04-28-09 13:47 


 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: