Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image dimension stacking #495

Merged
merged 16 commits into from
Jul 19, 2024

Conversation

hamshkhawar
Copy link
Member

This plugin will allows stacking of multidimensions (channel, timepoints, z-planes) and will be replacing functionalities of two existing plugin

  1. https://github.com/PolusAI/polus-plugins/tree/master/formats/polus-multichannel-tiff-plugin
  2. https://github.com/PolusAI/polus-plugins/tree/master/transforms/images/polus-stack-z-slice-plugin

Copy link

sweep-ai bot commented Jan 3, 2024

Apply Sweep Rules to your PR?

  • Apply: All new business logic should have corresponding unit tests.
  • Apply: Refactor large functions to be more modular.
  • Apply: Add docstrings to all functions and file headers.

Copy link
Collaborator

@nishaq503 nishaq503 left a comment

Choose a reason for hiding this comment

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

I believe this PR does not fulfill the requirements for the plugin. I have left comments as necessary. Let's discuss during/after a standup meeting.

Comment on lines 5 to 10
1. multi-channel `groupBy=c`\
For example `filePattern=x01_y01_p01_c{c:d+}.ome.tif`
2. multi-zplanes `groupBy=z`\
For example `filePattern=tubhiswt_C1-z{z:d+}.ome.tif`
3. multi-timepoints `groupBy=t`\
For example `filePattern=img00001_t{t:d+}_ch0.ome.tif`
Copy link
Collaborator

Choose a reason for hiding this comment

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

Add examples for when we have multiple variables and dimensions that are being stacked at once.

Comment on lines 22 to 26
[[tool.poetry.source]]
name = "test"
url = "https://test.pypi.org/simple/"
default = false
secondary = true
Copy link
Collaborator

Choose a reason for hiding this comment

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

This section should be removed

Copy link
Member Author

Choose a reason for hiding this comment

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

done

raise ValueError(msg)

if preview:
generate_preview(out_dir=out_dir, file_pattern=file_pattern)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Plugin should return after generating the preview.

Comment on lines 150 to 156
if group_by == "c":
bw.C = dim_size
if group_by == "t":
bw.T = dim_size
if group_by == "z":
bw.Z = dim_size
bw.ps_z = z_distance(input_files[0])
Copy link
Collaborator

Choose a reason for hiding this comment

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

The check should be for whether c, z or t are variables in the input filepattern, and not whether they are in (or equal to) the group_by input. Stacking should be done on all axes together.

input_files = []

fps = fp.FilePattern(inp_dir, file_pattern)
out_name = fps.output_name()
Copy link
Collaborator

Choose a reason for hiding this comment

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

The output should be in a per-group basis.

bw=bw,
)
threads.append(thread)
pm.join_threads()
Copy link
Collaborator

Choose a reason for hiding this comment

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

This function will block and will not return until all jobs are finished. The following tqdm progress bar is useless.

Copy link
Collaborator

Choose a reason for hiding this comment

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

See my comments from the PR with CZI Extraction plugin for this file.

@Nicholas-Schaub Nicholas-Schaub merged commit 750479d into PolusAI:master Jul 19, 2024
4 checks passed
@hamshkhawar hamshkhawar deleted the image-dimension-stacking branch July 23, 2024 21:38
hamshkhawar added a commit to hamshkhawar/image-tools that referenced this pull request Aug 15, 2024
* new plugin

* refactored code and added pytests

* adding plugin json and correcting documentation

* fixed documentation

* fixed documentation

* fixed documentation

* fixed documentation

* fixed documentation

* updating docker base container

* added multiple pattern support

* added docstring

* fix plugin name and test fixture

* test cli

* fixing multipattern test

* fix slow test

* fix slow test
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.

3 participants