Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 21, 2025

Updates README to use current preprocessor classes instead of the deprecated Preprocessor class, and provides comprehensive documentation with all available output options clearly marked as required or optional.

Changes Made

Examples Updated

  • Replaced deprecated Preprocessor with AtlasCentricPreprocessor in the Usage section
  • Added complete "Atlas-Centric Preprocessing" section with comprehensive example
  • Added complete "Native Space Preprocessing" section with comprehensive example
  • Show ALL possible output paths in both examples:
    • Raw outputs: raw_bet_output_path, raw_skull_output_path, raw_defaced_output_path
    • Normalized outputs: normalized_bet_output_path, normalized_skull_output_path, normalized_defaced_output_path
    • Masks (CenterModality): bet_mask_output_path, defacing_mask_output_path

Documentation Improvements

  • Enhanced introduction with comprehensive "Features" section explaining:
    • Core preprocessing steps (normalization, co-registration, atlas registration, brain extraction, N4 bias correction, defacing)
    • Preprocessing modes (Atlas-Centric vs Native Space)
    • Key benefits (modular, backend-agnostic, flexible output options, bidirectional transforms)
  • Clear parameter documentation: Every parameter marked as required or optional with inline comments
  • Dependency notes: Clarified that normalizer is required for any normalized_* outputs
  • Added "Key features" subsections for each preprocessor type
  • Improved structure with bullet points, notes, and better organization

Technical Details

  • Updated file paths to use proper Path objects consistently
  • Fixed parameter order consistency across both examples
  • Added explicit preprocessor.run() calls with all save directory parameters
  • Included optional backend customization comments
  • Changed paths to generic placeholders (/path/to/patient, /path/to/output)

Testing

  • ✅ Python syntax validated for both complete examples
  • ✅ All output options documented and explained
  • ✅ Required vs optional parameters clearly marked
  • ✅ Markdown structure verified

The README now provides comprehensive, user-friendly documentation that makes it easy to understand all available preprocessing options and clearly indicates what's required versus optional.

Fixes #161

Original prompt

This section details on the original issue you should resolve

<issue_title>[BUG] Outdated Readme example</issue_title>
<issue_description>Example uses old Preprocessor class. Also requires update in the tutorials repo</issue_description>

<agent_instructions>please include examples for both:
example_atlas_centric_preprocessor.py
and
example_native_space_preprocessor.py</agent_instructions>

Comments on the Issue (you are @copilot in this section)

Fixes #161


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

…or examples

Co-authored-by: neuronflow <7048826+neuronflow@users.noreply.github.com>
Copilot AI changed the title [WIP] Update Readme example for Preprocessor class Update README with AtlasCentricPreprocessor and NativeSpacePreprocessor examples Oct 21, 2025
Copilot AI requested a review from neuronflow October 21, 2025 12:19
Copilot finished work on behalf of neuronflow October 21, 2025 12:19
@neuronflow neuronflow marked this pull request as ready for review October 21, 2025 12:49
@Copilot Copilot AI review requested due to automatic review settings October 21, 2025 12:49
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Updates README examples to use current preprocessor classes (AtlasCentricPreprocessor and NativeSpacePreprocessor) instead of the deprecated Preprocessor class, providing clear guidance on when to use each workflow.

  • Replaced deprecated Preprocessor with AtlasCentricPreprocessor in the existing example
  • Added new complete example for NativeSpacePreprocessor showing native space workflow
  • Updated all file paths to use consistent Path objects and generic placeholders

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

README.md Outdated
Comment on lines 143 to 145
raw_bet_output_path=output_folder / "raw_bet/t1c_bet_raw.nii.gz",
raw_skull_output_path=output_folder / "raw_skull/t1c_skull_raw.nii.gz",
normalized_skull_output_path=output_folder / "normalized_skull/t1c_skull_normalized.nii.gz",
Copy link

Copilot AI Oct 21, 2025

Choose a reason for hiding this comment

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

[nitpick] The order of output paths is inconsistent with the atlas-centric example. In the atlas-centric section (lines 69-74), the order is raw_skull, raw_bet, raw_defaced, normalized_skull, normalized_bet, normalized_defaced. Here it's raw_bet, raw_skull, normalized_skull, raw_defaced. Consider maintaining the same order across both examples for consistency.

Copilot uses AI. Check for mistakes.
# specify the output paths for the raw and normalized images
raw_bet_output_path=output_folder / "raw_bet/t1c_bet_raw.nii.gz",
raw_skull_output_path=output_folder / "raw_skull/t1c_skull_raw.nii.gz",
normalized_skull_output_path=output_folder / "normalized_skull/t1c_skull_normalized.nii.gz",
Copy link

Copilot AI Oct 21, 2025

Choose a reason for hiding this comment

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

Missing normalized_bet_output_path and normalized_defaced_output_path which are present in the atlas-centric example. If these outputs are not applicable for native space preprocessing, this should be explained in a comment. Otherwise, for consistency with the atlas-centric example, these should be included.

Copilot uses AI. Check for mistakes.
README.md Outdated
# specify the output paths for the raw and normalized images
raw_bet_output_path=output_folder / "raw_bet/flair_bet_raw.nii.gz",
raw_skull_output_path=output_folder / "raw_skull/flair_skull_raw.nii.gz",
normalized_skull_output_path=output_folder / "normalized_skull/flair_skull_normalized.nii.gz",
Copy link

Copilot AI Oct 21, 2025

Choose a reason for hiding this comment

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

Missing normalized_bet_output_path and normalized_defaced_output_path which are present in the atlas-centric example. If these outputs are not applicable for native space preprocessing, this should be explained in a comment. Otherwise, for consistency with the atlas-centric example, these should be included.

Copilot uses AI. Check for mistakes.
@neuronflow
Copy link
Collaborator

@copilot please adress review comments :)

Co-authored-by: neuronflow <7048826+neuronflow@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Oct 21, 2025

@copilot please adress review comments :)

Fixed the review comments in commit f6f8b1c:

  1. ✅ Made parameter order consistent between atlas-centric and native space examples
  2. ✅ Removed normalized_bet_output_path and normalized_defaced_output_path from atlas-centric example (these were not in the actual example files)
  3. ✅ Both examples now use the same order: raw_bet, raw_skull, normalized_skull, raw_defaced

The examples now match the structure of the actual example files in the repository.

@neuronflow neuronflow requested a review from Copilot October 21, 2025 12:58
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copilot finished work on behalf of neuronflow October 21, 2025 12:58
Copilot AI requested a review from neuronflow October 21, 2025 12:58
@neuronflow
Copy link
Collaborator

@copilot in both examples we need to show all possible outputs, so with skull, bet and defaced with and without normalization mention what is optional and what are required inputs. Please also improve the general readme.

Co-authored-by: neuronflow <7048826+neuronflow@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Oct 21, 2025

@copilot in both examples we need to show all possible outputs, so with skull, bet and defaced with and without normalization mention what is optional and what are required inputs. Please also improve...

Enhanced the README in commit 1e7d8af:

Comprehensive Examples:
✅ Both examples now show ALL possible outputs:

  • Raw outputs: raw_bet_output_path, raw_skull_output_path, raw_defaced_output_path
  • Normalized outputs: normalized_bet_output_path, normalized_skull_output_path, normalized_defaced_output_path
  • Masks (CenterModality only): bet_mask_output_path, defacing_mask_output_path

Clear Parameter Documentation:
✅ Each parameter is now marked as required or optional with inline comments
✅ Added note explaining at least one output path must be specified
✅ Clarified that normalizer is required for any normalized_* outputs

Improved README:
✅ Enhanced introduction with Features section covering:

  • Core preprocessing steps
  • Preprocessing modes (Atlas-Centric vs Native Space)
  • Key benefits (Modular, Flexible, Bidirectional)
    ✅ Added Key Features lists for both preprocessor types
    ✅ Better structure and readability

Copilot AI changed the title Update README with AtlasCentricPreprocessor and NativeSpacePreprocessor examples Update README with comprehensive AtlasCentricPreprocessor and NativeSpacePreprocessor examples and improved documentation Oct 21, 2025
Copilot finished work on behalf of neuronflow October 21, 2025 13:09
@neuronflow neuronflow requested a review from Copilot October 21, 2025 13:10
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@neuronflow neuronflow requested a review from Copilot October 21, 2025 13:10
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@neuronflow neuronflow enabled auto-merge October 21, 2025 13:10
@neuronflow neuronflow disabled auto-merge October 21, 2025 14:34
@neuronflow neuronflow merged commit 6878ce1 into main Oct 21, 2025
10 checks passed
@neuronflow neuronflow deleted the copilot/update-readme-example branch October 21, 2025 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Outdated Readme example

2 participants