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

Open multiple images at once #20

Closed
droglenc opened this issue Jul 25, 2018 · 2 comments
Closed

Open multiple images at once #20

droglenc opened this issue Jul 25, 2018 · 2 comments
Assignees
Labels

Comments

@droglenc
Copy link
Owner

@droglenc droglenc commented Jul 25, 2018

A tester (B. Utrup and J-M Hessenauer) suggested that it would be nice if a user could "automatically" open several images at once so as not to have to go back to digitizeRadii() multiple times to supply a new image name. This suggestion stemmed from realizing that if this code is run

digitizeRadii("Scale_1.jpg",id=1,reading="DHO",edgeIsAnnulus=FALSE)
digitizeRadii("Scale_2.jpg",id=2,reading="DHO",edgeIsAnnulus=FALSE)

without completing the digitization after the first line of code, that the first image will appear and the second image will not appear until digitizing of the first image has been completed.

@droglenc droglenc self-assigned this Jul 25, 2018
@droglenc
Copy link
Owner Author

@droglenc droglenc commented Jul 25, 2018

It seems that this could be address is one of several ways.

  1. The user could simply write out all of the digitizeRadii() lines that they plan to run, run them all at once, and then sequentially work through the images. Like what the tester did.
  2. The user could use listFiles() to get a vector of image names in the current directory, put this vector into a loop, not supply an id= to digitizeRadii(), and then sequentially work through the images selecting a fish ID from a dialog box for each image. The code would look something like this.
    imgs <- listFiles(ext="jpg",other="Scale")
    for (img in imgs) digitizeRadii(img,reading="DHO",edgeIsAnnulus=FALSE)
    
  3. The user could use listFiles() to get a vector of image names in the current directory, could put the fish ID numbers in a vector, include these in a loop with digitizeRadii(), and then sequentially work through the images. The code would look something like this (note that the user would have to know the fish IDs).
    imgs <- listFiles(ext="jpg",other="Scale")
    ids <- c(1,2)
    for (i in seq_along(imgs)) digitizeRadii(img[i],id=ids[i],reading="DHO",edgeIsAnnulus=FALSE)
    
  4. I could modify digitizeRadii() so that if the first argument is a vector of length >1 then it would go into a loop. If the user did not supply id= then it would ask for it (similar to option 2 above). However, if the user supplied id= then its length would have to match that of the vector of images.

Options 2 and 4 could be made easier if the fish ID dialog box was initially populated with a better guess at the fish ID from the image file name. Currently the ID dialog box is initially populated with the image name (sans extension) such that the user can delete the part of the name that does not contain the ID. Perhaps assume that the fish ID is at the end of the filename and it follows an underscore. Could include an argument about whether the fish ID dialog box should be populated with this better guess (or just the image name). Alternatively, could write a getFishID() function that would create a vector of IDs from a vector if image names. This way the user could check that the IDs make sense and avoid having the dialog box come up.

@droglenc
Copy link
Owner Author

@droglenc droglenc commented Jul 27, 2018

Basically did options 2 and 4 above. Will be available in v0.0.11.

@droglenc droglenc closed this Jul 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.