Wrotea series of ImageJ/Fiji macros long time back (2017-18) to measure the shortest distance between two sets of objects in 2D images. Nothing fancy and could already be done now in other softwares.
Here, I present a series of ImageJ/Fiji macros for the shortest distance measurements between two sets of objects in 2D. - GitHub - ved-sharma/Shortest_distance_between_objects: Here, I present a s...
Great contributoin, thank you! I am having a small issue where when I run the script after adding in my Luke, and Multipoint ROIs, the output gives me numerous distances between the line and the points. I know the line is a composite ROI of numerous points, and it looks like the script is drawing lines from the multipoint ROIs (in this case, from the cells) to the composite ROI (in this case the freehand line I line the surface of the vessel with). I am unsure how to only get a single shortest distance between the line and the cell, any ideas?
I'm still relatively new to regex. I'm trying to find the shortest string of text that matches a particular pattern, but am having trouble if the shortest pattern is a substring of a larger match. For example:
This might be a useful application of sexegers. Regular-expression matching is biased toward the longest, leftmost choice. Using non-greedy quantifiers such as in .*? skirts the longest part, and reversing both the input and pattern can get around leftmost-matching semantics.
The regex engine starts searching from the beginning of the string till it finds a match and then exits. Thus if it finds a match before it even considers the smaller one, there is no way for you to force it to consider later matches in the same run - you will have to rerun the regex on substrings.
Setting the global flag and choosing the shortest matched string won't help as it is evident from your example - the shorter match might be a substring of another match (or partly included in it). I believe you will have to start subsequent searches from (1 + index of previous match) and go on like that.
I do not think that this task can be accomplished by a single regular expression. I have no proof that this is the case, but there are quite a lot of things that can't be done with regexes and I expected this problem to be one of them. Some good examples of the limitations of regexes are given in this blog post.
Currently, there's an oppurtunity for some of my photographs to be printed by an agency and they're asking me to resize the photo (landscape photograph) to 1.5 meters or 60"on the SHORTEST SIDE. How do I do this?
I've only used Lightroom to post process photos and never experienced resizing photographs, I recently purchased Photoshop on my Mac but I am still a little bit lost and I badly need help. Like step by step visual guides.
I would recommend that you resize with the resampling option inactive so that the file size/pixel size does not change, you will then know what the effective print resolution or PPI value is. For a print that is 60" on the shortest side, I doubt that you will need 300ppi and I'm guessing that this will be printed on an inkjet and viewed and more than arms distance. This is why it is important to know what the effective PPI value is, before you resample/interpolate new pixels.
I hope the suggestions already posted have been helpful. I just thought I would give you my resizing workflow as another option. It has served me well in many years of creating large oversized graphics.
2. If your images are not at 300 ppi, then use Image Size and uncheck the "Resample" box. This will link the width and height and resolution and any changes you make will reapportion the pixels you already have in your document. Select the Resolution field and type in 300. This will show you exactly how large your document is at 300 ppi.
3. Next, re-check the Resample box, because now we are going to add pixels. From the Drop Down menu next to Width, change the option to Percent, and then change the value in the Width field to 150. Change the Resample drop down menu to "Bicubic Sharper (Reduction)". (I know what it says, but it works!) And then click ok. This will increase your image by 50% larger than the original.
4. Follow these steps until your image is as large or slightly larger than what you need. You can apply a sharpening filter to sharpen the image when you are done enlarging it, or even gradually between each enlarging process.
5. Once you have enlarged your image, and it might be slightly larger than the 60 inches, use the Image Size dialog, make sure Resample is checked, and change the short edge to 60 inches to get your exact size.
It seems that every few years I hear someone ask this question; it seems to hold a perennial fascination for research mathematicians, just as quests for short proofs do. The trouble is that it has strong urban-legend tendencies: someone will say, "So-and-so's thesis was only $\epsilon$ pages long!" where $\epsilon \ll 1$. It will often be very difficult to confirm or disconfirm such claims, since Ph.D. theses are often not even published, let alone readily available online. If you Google around for a while, as I did, you will find many dubious leads and can easily waste a lot of time on wild goose chases. Frankly, I'm a bit fed up with this state of affairs. I am therefore asking this question on MO in the hope that doing so will put this old question to rest, or at least establish provable upper bounds.
I would therefore request that you set yourself a high standard before replying. Don't post a candidate unless you're sure your facts are correct, and please give some indication why you're so sure. Read the meta discussion before posting. (Note that the meta discussion illustrates that even a MathSciNet citation isn't always totally definitive.) Include information about the content and circumstances of the thesis if you know it, but resist the temptation to gossip or speculate.
I'm not making this question community wiki or big-list because it should ideally have a definite answer, though I grant that it's possible that there are some borderline cases out there (perhaps there are theses that were not written in scholarly good faith, or documents that some people would regard as equivalent to a Ph.D. thesis but that others would not, or theses in subjects that are strictly speaking distinct from mathematics but that are arguably indistinguishable from mathematics dissertations).
Finally, to anticipate a possible follow-up question, there is a list of short published papers here (search for "Nelson"). Note that the question of the shortest published paper is not as urban-legendy because the facts are easier to verify. I looked up the short papers listed there myself and found them to be quite interesting. So in addition to trying to settle an urban legend, I am hoping that this question will bring to light some interesting and lesser known mathematics.
This is not really an answer because these PhD's were never actually written, but anyway: in his book A mathematicians miscellany (in the chapter on math with minimum raw material) Littlewood gave 2 examples that could have been 2-line PhDs:
The first three works of Godel in this volume are his dissertation of 1929 (twenty-one pages in English), a revised and substantially abbreviated version (eleven pages in English) published in 1930, and a brief abstract based on a presentation of Godel's results in Konigsberg on 6 September 1930. Of all of Godel's longer, published writings, his dissertation has been, until now, the most difficult to obtain, and is here translated for the first time into English, by Stefan Bauer-Mengelberg and van Heijenoort.
I'm trying to solve a problem that is not very complicated, but I can't seem to find a good solution in ESRI. I have different medi-cal clients and each one sees a different provider. In the dataset, I have client geolocation and provider geolocation, and I want to find the distance (shortest in time/or distance) for each client-provider pair. This is not an OD-cost matrix problem. It would seem to be a shortest path problem; however, it seems that shortest path is not really built for finding the shortest path between many different pairs. Instead, it is setup for finding the shortest path between many different points on a route. Essentially, if I wanted to find Euclidean distance, in geopandas it would be easy with geopandas.distance() command; however, I want to incorporate roadways.
Assuming you have access to the Network Analyst extension that Dan has linked, you setup your Start and Finish points with Route Names. You need a start point to go with each corresponding finish point. Think of it like this - if you have Point A and you want to calculate routes to Points M, N & O, you need 3 copies of Point A, each with a unique Route Name that is also referenced by each finish point (i.e. Route A-M, A-N & A-O). When you run the Solve tool to calculate routes, it recognises those route names and calcs the route from A to N, then another for A-M and again for A-O. The same dataset could also then contain start points B, C, etc and other finish points, and as long as you have those start points copied and named to match each required finish location, it will only calculate those routes. It seems like a simple concept, but it took me a while to figure this out so, thought I'd share it.
Below is an extract from a python code that generates the Start and Finish points based on 2 input datasets (the start points actually being polygons so you can see the dissolve and conversion steps added in to deal with this). The code goes on to solve the network too, but I haven't added that as I haven't got it running properly in an automated manner (which is how it is supposed to run). I have a model that does this too for users to use in ArcGIS Pro (what I used to build the below code in the first place).
My bad -- I didn't catch that you already had the provider-client pairs. You can find the paths between them using the Route Analysis solver. Each stop (the point to visit along the route) can be assigned its own unique RouteName. The solver will create a shortest path for each unique RouteName. So, just give each of your provider-client pairs a unique RouteName. Set the client point as the route origin (sequence = 0) and the provider as route destination (sequence=1). Of course this means you'll have to duplicate points for the providers, one point for each client assigned to that provider. It seems you know Python pretty well, so maybe write a script that takes the provider-client pairs and their locations and outputs a point feature class with two features for each pair along with the RouteName/Sequence. (This would be useful code to share)
3a8082e126