Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3395384
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T04:17:01+00:00 2026-05-18T04:17:01+00:00

I quickly searched for this before posting, but could not find any similar posts.

  • 0

I quickly searched for this before posting, but could not find any similar posts. Let me know if they exist.


The commands being executed seem very simple. A directory listing is used as the input for a function.

The directory contains a bunch of files named “epi1_mcf_0###.nii.gz”

Command-line version (bash is running when this is executed):

fslmerge -t output_file `ls epi1_mcf_0*.nii.gz`

Shell script version:

#!/bin/bash
fslmerge -t output_file `ls epi1_mcf_0*.nii.gz`

The command-line version fails, but the shell script one works perfectly.

The error message is specific to the function, but it’s included anyway.

** ERROR (nifti_image_read): failed to find header file for 'epi1_mcf_0000.nii.gz'
** ERROR: nifti_image_open(epi1_mcf_0000.nii.gz): bad header info
Error: failed to open file epi1_mcf_0000.nii.gz
Cannot open volume epi1_mcf_0000.nii.gz for reading!

I have been very frustrated with this problem (less so after I figured out that there was a way to get the command to work).

Any help would be appreciated.

(Or is the general consensus that the problem should be looked for in the “fslmerge” function?)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T04:17:02+00:00Added an answer on May 18, 2026 at 4:17 am

    (I mentioned this in a comment first, but I’ll make an answer since it helped!)

    Do you have any shell aliases defined? (Type alias) Those will affect commands typed at the command line, but not scripts.

    Linux often has ls defined as ls --color. This may affect the output since the colour codes are sent as escape codes through the regular output stream. If you use ls --color=auto it will auto-detect whether its output is a terminal or not. From man ls:

    By default, color is not used to distinguish types of files. That is
    equivalent to using --color=none. Using the --color option without the
    optional WHEN argument is equivalent to using --color=always. With
    --color=auto, color codes are output only if standard output is connected to a terminal (tty).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

(apologies if this has come up before, I've searched but not found anything for
I have searched this, but I could'n find or understand what I found. Now
Can this be done quickly in jQuery before I start looping through them? Or
I know that I can do this via profiles in Firefox, but is there
This is not a programming question per se but a question about searching source
Can't seem to find this on google. But on a linux machine, how would
So, I searched some here, but couldn't find anything good, apologies if my search-fu
Is there any way I can use RegExp or Wildcard searches to quickly delete
I've quickly made up a sliding doors example but I'm incorporating it into my
First off, I'm not terribly experienced in XML. I know the very basics of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.