save

matlab: how to save TIFF series?

自作多情 提交于 2019-12-05 07:47:36
Lets say I have a 3D array 'img' (x, y, frame) and want to save it as a TIFF. So far I was doing it by saving one-by-one like this: for K=1:length(img(1, 1, :)) outputFileName = sprintf('img_%d.tif',K); imwrite(img(:, :, K), outputFileName); end cool, but what if I want to save it as a one tiff stack? How to do it? Thanks :) Clement J. The parameter ' append ' seems to correspond to what you want. outputFileName = 'img_stack.tif' for K=1:length(img(1, 1, :)) imwrite(img(:, :, K), outputFileName, 'WriteMode', 'append'); end EDIT: IMAGEJ has problems when opening multipletiffs saved like that.

Where should I save my file in Android for local access?

こ雲淡風輕ζ 提交于 2019-12-05 07:42:56
问题 I have two datasets which are currently in the same folder as my java files AND on my PC. Currently, I am accessing them through my C-drive. Since this is an app, where should I save my .ARFF files and what path should I use instead? I have tried in the raw folder, but nothing seems to work. Here's what I have so far... 回答1: Create a raw directory in your project, raw is included in the res folder of android project. You can add an assets files in raw folder like music files, database files

Using Jquery and Ajax to save a file in ASP.Net

人盡茶涼 提交于 2019-12-05 06:11:27
I have a button that uses jQuery and ajax to call a server side script to create a text file and sends back the following response: Response.ContentType = "csv"; Response.AddHeader("Content-disposition", "attachment; filename=" + fName); Response.ContentType = "application/octet-stream"; Response.BinaryWrite(btFile); Response.End(); However, the save dialog does not appear. If I don't use ajax and perform a full postback with the same code, it works. Any ideas? Here is the jQuery code: $(function() { $('#reportButton').click(function() { $.ajax({ type: "POST", url: "GenerateReport.aspx", data:

How to save files to Android /system directory?

耗尽温柔 提交于 2019-12-05 05:02:45
问题 I am writing an application that will copy files from its assets directory to the Android's /system directory. I feel that I am getting close to achieving this, but I am not quite there. Here is the strategy that I have attempted: First, I tried to change the permissions of the /system directory by: Runtime.getRuntime().exec("su"); Runtime.getRuntime().exec("mount -o rw,remount -t yaffs2 /dev/block/mtdblock4"); Runtime.getRuntime().exec("chmod -R 777 /system"); Second, I tried to write a file

iPhone - Save URL without setURL:forKey: and NSURL

无人久伴 提交于 2019-12-05 04:48:38
问题 Is there anyway to save a URL with NSUserDefaults without setURL:forKey: that is only available to iOS 4.0 and later? I am loading HTML files locally with fileURLWithPath, and it starts at an intro page and the user can click through to whatever. For now, everytime a user starts over it loads back default to intro.htm. I would like to be able to save their current page to NSUserDefaults on viewdiddissapear and reload it next time, but can't find any solutions besides setURL:forKey:. Anyone

ANDROID: Saving PreviewCallback image as a .jpg from a byte array results in a corrupt file

早过忘川 提交于 2019-12-05 03:43:07
问题 I have been augmenting the QR scanning library Zxing to save a photo instantly upon scan. I was advised to do so within the onPreviewFrame method within PreviewCallback.java as thus: public void onPreviewFrame(byte[] data, Camera camera) { Point cameraResolution = configManager.getCameraResolution(); Handler thePreviewHandler = previewHandler; YuvImage im = new YuvImage(data, ImageFormat.NV21, 1200, 800, null); Rect r = new Rect(0, 0, 1200, 800); ByteArrayOutputStream baos = new

Saving class-based view formset items with a new “virtual” column

雨燕双飞 提交于 2019-12-05 02:38:48
I have a table inside a form, generated by a formset. In this case, my problem is to save all the items after one of them is modified, adding a new "virtual" column as the sum of other two (that is only generated when displaying the table, not saved). I tried different ways, but no one is working. Issues : This save is not working at all. It worked when it was only one form, but not for the formset I tried to generate the column amount as a Sum of box_one and box_two without success. I tried generating the form this way too, but this is not working: formset = modelformset_factory( Item, form

Jenkins: how to save changelog for build

眉间皱痕 提交于 2019-12-05 02:07:43
问题 I have Jenkins-CI and C++ project under SVN. How to save changelog between successfull builds into text (or html) file ? Does Jenkins have any variable/temp file with content of .../changes page? 回答1: Here is XPath code that can get you the changeset for a given build id via Jenkins API: http://[jenkins_host]/api/xml?depth=2&xpath=//build/id[text()='${BUILD_ID}']/../changeSet (Put actual build id instead of ${BUILD_ID}). This can be used by a script (say, a Pyhon script utilizing Python

How to bookmark a webpage in an Android application?

不羁岁月 提交于 2019-12-05 01:49:01
问题 I am developing a Newspaper like application. I'm wondering how to save webpages with the click of a button and display it at a later point in time. I googled for this in vain. If anyone knows how to do this and can provide some useful links, it would be greatly appreciated. 回答1: Perhaps you can just save the url in a database together with the favicon or try to get a screenshot from the site to use as icon? You could probably convert the Webview to a Drawable/Bitmap without too much problems

How can i save a list to a file and read it in again (in R)?

試著忘記壹切 提交于 2019-12-04 23:38:35
I´ve estimated a model with the poLCA-package in R and want to save the starting values to a file, so i can re-estimate exactly the same model anytime. This is a list of starting values for one model: List of 8 $ : num [1:2, 1:6] 0.219 0.193 0.16 0.193 0.184 ... $ : num [1:2, 1:6] 0.0731 0.2054 0.228 0.144 0.2028 ... $ : num [1:2, 1:6] 0.0396 0.0965 0.0286 0.1494 0.1609 ... $ : num [1:2, 1:6] 0.20998 0.173634 0.105792 0.000588 0.06236 ... $ : num [1:2, 1:6] 0.163 0.19 0.167 0.178 0.246 ... $ : num [1:2, 1:6] 0.1602 0.1438 0.1963 0.0848 0.2218 ... $ : num [1:2, 1:6] 0.0298 0.3022 0.2179 0.094 0