I have got a ton of dicom files that I want to mass rename using their properties tags.
My question is, what is the syntax for taking a property tag(such as dcm:SeriesNumber) for every image and using it to rename the images in the directory?
I'm guessing it involves breaking it down to the relevant tag using -identify -verbose and then somehow passing that string over to the filename property?
Really would appreciate the help(using win10 command line).
Figured it out.
convert *.dcm -set filename:f "%[dcm:SeriesNumber]"_"%[dcm:AcquisitionNumber]" "%[filename:f].jpg"
the "" after filename:f hold the string that's going to represent the file name
[] brackets hold the metadata property, that you can chain by using % percentage sign which declares a new property
Related
I call the function XLoadQueryFont(port->dpy, "8x13"), but it returns a NULL. I'm pretty sure I had this working before. If I type locate 8x13, one of the results is
/usr/share/fonts/misc/8x13.pcf.gz
I don't know what the function dislikes, and was wondering as to how to track the problem down.
Update:
Using "fixed" produced an app that executed.
Based on tofo's comments:
I had to install the xlsfonts binary on Arch to get xlsfonts. It listed adobe, lucida, bitstream and misc fonts. xlsfonts | grep misc returned
-misc-fixed-medium-r-semicondensed--0-0-75-75-c-0-iso8859-1
-misc-fixed-medium-r-semicondensed--13-100-100-100-c-60-iso8859-1
-misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso8859-1
Most probably you have deleted or corrupted your fonts.alias file in /etc/X11 (or similar location, depending on your distribution, can be anywhere in the font path).
The "8x13" is typically no name, but rather an alias that is defined in this file.
To ensure your server can use this font name, check that your fonts.alias file contains at least the lines (note your actual font names might vary)
8x13 -Misc-Fixed-Medium-R-SemiExpanded--13-120-75-75-C-80-ISO8859-1
8x13bold -Misc-Fixed-Bold-R-SemiExpanded--13-120-75-75-C-80-ISO8859-1
If those aliases are not present or don't resolve to a valid font, you cannot use the "8x13" name. More aliases can be defined as needed.
I have an E-commerce website and have multiple products and images.
I want to add dimensions after every product images which have already uploaded.
Ex: product_name_1024x1024
Is there any way or I have to rename images 1 by 1.
I would recommended installing Netzarbeiter_NicerImageNames; https://github.com/Vinai/nicer-image-names
With this extension, you can define a mask for the image file names being shown on the frontend. Unfortuantely, it does not have a %width or %height attribute by default so you'll need to modify the extension.
I've taken a quick look and can point you in the right direction; add the filename variable as an argument to _getGeneratedNameForImageAttribute() so it will be _getGeneratedNameForImageAttribute($attributeName, $map = null, $forFiles = true, $fileName = null). Use getimagesize() to find width and height attribute when $fileName is not null and map 'width' and 'height' to these variables (see requestHost for example). Then look for every place in the code where _getGeneratedNameForImageAttribute() is called and add in the filename variable used within that function.
Finally, add the %height and %width variables to your map in the configuration under Catalog.
How would I go at converting .3DC + .DDS files into .OBJ + .MTL + .TGA?
This is actually very simple to do, this goes for mostly any file format but for this I'll be using .3DC file. Download 3D Object Converter, you'll have to pay a fee if you want the program to completely convert your object without removing every 5th quad or triangle. After you've done that open it and go into the menu and click batch convert. Add your file you want to convert change the options so that they suit you and choose the export for .obj Wavefront don't take any other type of .obj file format. You can find it near the end of the list. Then convert the file. And voila!
If your texture is in dds format or whatever and you want to change it to tga, just use an online picture converter.
After that amend the file.mtl and change to the correct texture it should call to.
And there you go!
I pieced together a pipeline that returns a list of files and their paths if said files match prescribed patterns:
Param ($dropDir)
$MatchingScripts = Get-ChildItem $dropDir\*.sql -Recurse
| Select-String -pattern \*ONEFISH\*,\*TWOFISH\*,\*REDFISH\*
| group path
| Foreach-Object {$_.Name}
| Out-File D:\logging\scrubfiles.log
return $MatchingScripts
So there's one param in there where I feed in the dynamically-named drop path every time and search down that path. The goal then is to return $MatchingScripts array to the build template and throw the array into a ForEach<string> loop that will InvokeProcess on a custom tool which will scrub each \path\file\ and replace said token value patterns.
Problem: I can't get that array from PowerShell fed back to the team build. I've tried containing the script in a .ps1 along with a closing return $MatchingScripts ...but nothing is reaching the pre-defined IEnumerable<String> by the same name 'MatchingScripts' in the build template.
I'm still trying to make the TFSBuildExtensions InvokePowerShellCommand activity to do this for me, as well, but the problem there is a conversion of types that have to be overcome (PSOBject to Array of Strings).
They key bit is that tool I have to send this array through needs to consist of strings.
If it were me I'd just loop through and call your custom tool directly from PowerShell, rather than trying to pass data back to WF and doing it from there.
Here's the work-around we used to return value:
Since what we piped out to log was clean (just files & paths), we read the log back into an array of strings via the Assign activity using a VB expression...
MatchingScripts = File.ReadAllLines("D:\logging\scrubfiles_" + BuildDetail.BuildNumber.ToString() + ".txt")
There's a little concatenation there because we later chose to individualize the each log according to the 'build' it ran under. Anyway, it worked a treat!
Moral of the story: understand that if you want to return ANYTHING other than an integer value from PowerShell/InvokeProcess, be prepared to write/find a custom activity or come up with some other work-around that can feed directly back into Workflow.
I'm using this script to replace a value in a property file located into a jar file.
<replace file="/cygdrive/d/ant/test/target/com/test/resources.properties" token="MyKey" value="MyNewValue">
the property file is :
MyKey=My Old Value
This script will replace MyKey by MyNewValue
Or what I need is to replace the My Old Value by the MyNewValue?
You might use the Ant propertyfile task, something like:
<propertyfile file="/cygdrive/d/ant/test/target/com/test/resources.properties">
<entry key="MyKey" value="MyNewValue"/>
</propertyfile>
The replace task is simple string replacement, and it did exactly what you asked it to do -- replaced the occurrence of the string "MyKey" with the string "MyNewValue" in the properties file (it doesn't know it's a property file, just treats it as text.) If you want it to replace "My Old Value" then that's what you'd specify in the token parameter.
If you're just looking to have placeholder values in a properties file that you set at build/deploy time, then you might want to look at the filter task if you have lots of properties to deal with.