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

Manual attribute assignment #17

Merged
merged 5 commits into from
May 21, 2021
Merged

Manual attribute assignment #17

merged 5 commits into from
May 21, 2021

Conversation

bryantChhun
Copy link
Contributor

Addresses issue #16

This PR simply enables the raw ability to modify the multipage/singlepage tiff class's dimensions from the reader.

Might enable us to manually adjust image dimensions for acquisitions that have been cut short. That condition requires additional testing.

@bryantChhun bryantChhun requested a review from camFoltz May 19, 2021 19:03
@camFoltz
Copy link
Contributor

Changing an attribute at the MicromanagerReader level doesn't propogate those changes down into the MicromanagerReader.reader level (the multipage tiff or singlepagetiff reader). I think these need to be propogated downward for the changes to have meaningful impact

@bryantChhun
Copy link
Contributor Author

Changing an attribute at the MicromanagerReader level doesn't propogate those changes down into the MicromanagerReader.reader level (the multipage tiff or singlepagetiff reader). I think these need to be propogated downward for the changes to have meaningful impact

When I run the tests here it works. Adding new lines to force it to fail works too:

def test_height(setup_mm2gamma_ome_tiffs):
    _, _, rand_folder = setup_mm2gamma_ome_tiffs
    mmr = MicromanagerReader(rand_folder,
                             'ometiff',
                             extract_data=False)
    orig_height = mmr.height
    mmr.height = 100
    assert(mmr.height == mmr.reader.height) #<-- this passes
    assert(mmr.reader.height == orig_height) #<-- But this fails
    assert(mmr.height == orig_height) #<-- This also fails

@camFoltz
Copy link
Contributor

Changing an attribute at the MicromanagerReader level doesn't propogate those changes down into the MicromanagerReader.reader level (the multipage tiff or singlepagetiff reader). I think these need to be propogated downward for the changes to have meaningful impact

When I run the tests here it works. Adding new lines to force it to fail works too:

def test_height(setup_mm2gamma_ome_tiffs):
    _, _, rand_folder = setup_mm2gamma_ome_tiffs
    mmr = MicromanagerReader(rand_folder,
                             'ometiff',
                             extract_data=False)
    orig_height = mmr.height
    mmr.height = 100
    assert(mmr.height == mmr.reader.height) #<-- this passes
    assert(mmr.reader.height == orig_height) #<-- But this fails
    assert(mmr.height == orig_height) #<-- This also fails

Weird, for some reason when I was doing it through the python console in pycharm it wasn't working. I ran your tests and tested it out in a notebook and it worked fine. Definitely a nice feature to have, thanks!

@camFoltz camFoltz merged commit 6b97e79 into master May 21, 2021
@bryantChhun bryantChhun deleted the manual_attribute_assignment branch May 25, 2021 19:44
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