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

Revise the jython script for timelapse movies #27

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

sebherbert
Copy link

This revision allows the user to select a multi-timepoint tif.

The script automatically checks the number of timepoints in the .tif file and process each timepoint independently before saving each timepoint in an output folder with the extension _frameN appended to the original filename.

GUI file browsing to select the images and path handling are simplified

sebherbert added 6 commits June 5, 2019 12:28
Script parameters allow for the search of files in the computer, simplifying the search
This modification allows the selection of an hyperstack with multiple frames as an input.
This doesn't apply to the selection of a folder of images yet, but could be done later.
I changed the tests directory tests and file name handling using path.join
 instead of adding a "/". This should make the script Windows compatible.
Added a test to exit the process if user specified a single tif file output
while processing a multiframe input
change the io.open for IJ.openImage. IJ.openImage is needed in the first call since it requires ImagePlus methods
Got rid of the inputPath argument. It is now directly extracted from the imp.
@fjug
Copy link
Collaborator

fjug commented Jun 20, 2019

@frauzufall Have you seen this?

@frauzufall
Copy link
Member

Thank you for working on this, @sebherbert @tinevez! I am going to review this as soon as I find the time.

@frauzufall
Copy link
Member

Hi @sebherbert, I had a moment to look at the code. Can you help me out, why can you not run the network with the whole hyperstack? I thought the TensorFlow networks usually have a first dimension which can be used for this purpose. Do you get into trouble with the size of the stack? Do you want to normalize individually per timeframe? Or are there other issues I might be unaware of?

@sebherbert
Copy link
Author

Argh... It seems I indeed misunderstood the properties of io.open() output.
I must have got confused because when I used the original script to run on an hyperstack, the output (as opened by Fiji) was an image stack and I thought it processed the image as a single 3D stack.

So it is indeed processing the hyperstack as needed. Sorry for the confusion...

After searching more, I now see that the output image is only opening as an hyperstack if SCIFIO default loader is enabled under “Edit - Options - ImageJ2” of Fiji. This option is disabled by default and still in Beta version, so it might be useful to warn the users of this behaviour or add a boolean to save as IJ1 or IJ2 tiff format? Unless I am still missing something of course.

There might still be some useful changes in the pull request concerning the path handling, I can revert my changes and add the small boolean to offer the user an other save format if you think it could be useful?

Sebastien

@frauzufall
Copy link
Member

Thanks for following up on the stacks, I also did not know this. This work you put into this script is definitely useful!! I think I will keep the parts with the path handling and maybe add a second script which processes the time points individually as you suggested, I think this could still be relevant to people because of the other issues I mentioned (size limits, independent normalization). But I try to avoid IJ1 code as much as possible.

@sebherbert sebherbert marked this pull request as ready for review July 16, 2019 14:48
@sebherbert
Copy link
Author

Glad it can be useful then and I completely agree.
Let me know if I can be of help and thanks for all the efforts!

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.

4 participants