Skip to content
This repository has been archived by the owner on Jul 8, 2022. It is now read-only.

Fix the volume writing when there are dots in the output path #63

Merged
merged 1 commit into from Oct 13, 2016

Conversation

jafyvilla
Copy link
Contributor

When a "." was present in the specified --output path, the voxelize
app was failing to find the extension, leading to unexpected behaviors.
Now only the file name is considered to search for the extension.
Also, now it's possible to write also series of volumes using a different
format than the default (.mhd).


// Consider only the filename to check whether there is an extension or not
const std::string& fileName =
filePath.substr( filePath.find_last_of("/") + 1 );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is wrong, if there is no / find_last_of returns std::npos and I don't know what std::npos + 1 returns (if it's defined at all), but most probably 0.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right. It was working without a problem just because npos = 18446744073709551615, so fileName = filePath.
Fixed now.

When a "." was present in the specified --output path, the voxelize
app was failing to find the extension, leading to unexpected behaviors.
Now only the file name is considered to search for the extension.
Also, now it's possible to write also series of volumes using a different
format than the default (.mhd).
@jafyvilla jafyvilla merged commit 7c20d16 into BlueBrain:master Oct 13, 2016
@jafyvilla jafyvilla deleted the fix branch October 20, 2016 09:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants