Skip to content

Development#60

Merged
amirDahari1 merged 28 commits into
mainfrom
development
Jul 25, 2025
Merged

Development#60
amirDahari1 merged 28 commits into
mainfrom
development

Conversation

@amirDahari1

Copy link
Copy Markdown
Member
  1. Latest figure changes.
  2. Added backend batch segmentation (just with an added flag - code works with one image as before).
  3. Links to github from website.
  4. fixed rgba tiff problem.
  5. 3 decimal places in website text.

@amirDahari1 amirDahari1 requested a review from rmdocherty May 28, 2025 15:35
@amirDahari1

Copy link
Copy Markdown
Member Author

@rmdocherty after this is merged could you please have this in prod as well? the 3 decimal places are important for me :)

@amirDahari1 amirDahari1 requested a review from Copilot June 6, 2025 15:33

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements several development updates spanning both backend and frontend code, addressing image processing improvements, new testing scenarios, and documentation/link updates.

  • Updated test cases for CLS estimation and image stack handling
  • Enhanced backend processing for RGBA TIFF images and added a batch segmentation flag
  • Improved frontend UI text, hyperlink targets, and CI configuration

Reviewed Changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
tests/tests.py Updated test image dimensions, assertion thresholds, and added image stack tests
representativity/server.py Modified TIFF processing logic and added debug prints
representativity/core.py Introduced new image size constants and refined CLS correction logic
paper_figures/model_accuracy.py Extended prediction interval function with confidence parameter
paper_figures/introduction.py Updated figure labels and file paths for clarity
frontend/src/components/imageLogic.tsx Added guard for empty arrays in phase fraction calculation
frontend/src/components/Popups.tsx Updated links and added extra instructions in popups
frontend/src/components/Menu.tsx Refactored phase fraction display logic and removed precision function
frontend/src/components/DragDrop.tsx Improved drag/drop UI with additional user guidance
README.md Updated preprint link in documentation
CITATION.cff Revised DOI and URL information
.github/workflows/tests.yaml Adjusted branch filter for CI workflows

Comment on lines 118 to 125
if len(arr.shape) == 3 and arr.shape[0] == 1:
# weird (1, H, W) tiffs
arr = arr[0, :, :]
if len(arr.shape) == 3 and arr.shape[-1] == 3:
# weird (H, W, 3) tiffs
arr = np.transpose(arr, (-1, 0, 1))
if len(arr.shape) == 3 and arr.shape[0] == 3:
if len(arr.shape) == 3 and (is_rgba or is_rgb):
arr = arr[:, :, 0] # take only R channel of RGB(A) arrays, like on frontend
if len(arr.shape) == 3 and (is_rgba or is_rgb):
# any (3, H, W) tiffs -> (H, W)
arr = arr[0, :, :]

Copilot AI Jun 6, 2025

Copy link

Choose a reason for hiding this comment

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

Duplicate condition in preprocess_arr may cause unintended behavior by slicing the array twice in succession. Consider combining the logic to ensure the correct channel is selected once.

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@rmdocherty is that intended?

Comment thread representativity/server.py
Comment thread representativity/core.py
Comment thread frontend/src/components/Menu.tsx
Comment thread .github/workflows/tests.yaml Outdated
Comment thread representativity/core.py
Comment thread tests/tests.py
not every branch will trigger tests, but adding development

@amirDahari1 amirDahari1 left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@rmdocherty just look at this one duplicate if statement in server.py if that was your intention.

Comment thread representativity/core.py
Comment thread representativity/server.py
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.

2 participants