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

  • SEARCH
  • Home
  • 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

I have quickly read over the Microsoft Lambda Expression documentation. This kind of example
Can anyone recommend a tool for quickly posting test messages onto a JMS queue?
This simple solution popped into my mind quickly. #include <ctype.h> int digit_exists_in ( const
I've followed this example: RCP+JavaWS but the app just briefly comes up and goes
I would like to quickly send email from the command line. I realize there
Sometimes I need to quickly extract some arbitrary data from XML files to put
I need to quickly (and forcibly) kill off all external sessions connecting to my
I have quickly read (and will read with more care soon) the article of
I need to quickly build a parser for a very simplified version of a
I need to be able to quickly convert an image (inside a rails controller)

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.