Skip to content

include header when writing nifti from R #8

@ebrahimebrahim

Description

@ebrahimebrahim

# Create each feature folders for each image
for (feature in c("allocation", "transport", "vbm")) {
feature_dir = file.path(img_dir, feature)
dir.create(feature_dir)
writeNifti(res$im[[feature]], sprintf("%s/correlation.nii.gz", feature_dir))
writeNifti(res$pim[[feature]], sprintf("%s/pvalue.nii.gz", feature_dir))
}
}
}

The spacing information from the original feature images that were analyzed is not passed into the writeNifti here^^
So we should use the template argument of writeNifti; see documentation.
Pass to the template argument the result of applying readNifti to one of the feature images that were used for analysis.

This way when our analysis results visualizer looks at nifti images that were written here, it knows how to display them in relation to the atlas.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions